There are similar threads on stack but I didn’t find any suitable for me.
I have body background which I want to change after a click.
$('#start').click(function(){
$(this).fadeOut('slow');
$('#help').fadeOut('slow');
$('#exit').fadeOut('slow');
setTimeout(function(){
$('body').css('background-image','url(media/note.jpg)');
},500);
});
So, I want the new background to fadeIn. I’ve tried adding it in every way possible which I could thought of but without luck.
Is there a way to do so?
You could use jQuery UI library to add a class with a delay, like this:
where the class “note” would look like:
To use jQuery UI library, make sure to add the following scripts to your html HEAD tag:
Check out this jsFiddle for an example: CLICK!