I have a functio开发者_如何学Cn, that will print out some text, while an iframe content is loading:
// set "waiting" message:
$("#loadingStatus").html("Waiting for your advertisements to load...");
My question is, how do I add the fadeIn("slow") to the loading message above? I tried adding .fadeIn("slow") in the same line, but that did not work.
You probably have to hide your element first, since fadeIn() won't do anything if the element is already visible:
$("#loadingStatus").hide().html("Waiting for your advertisements to load...")
.fadeIn("slow");
What you can do is, make the #loadingStatus
fadeOut/hide first and then add the html and then fadeIn again like so:
$('#loadingStatus').hide().html('Your message here').fadeIn('slow');
Hide it first:
$("#loadingStatus").hide().html("Waiting for your advertisements to load...").fadeIn("slow");
精彩评论