开发者

More effects, to one function. Jquery

开发者 https://www.devze.com 2023-03-26 09:31 出处:网络
I have a functio开发者_如何学Cn, that will print out some text, while an iframe content is loading:

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");
0

精彩评论

暂无评论...
验证码 换一张
取 消