开发者

except jquery lazy load, how to add a `loading.gif` when php images are loading?

开发者 https://www.devze.com 2023-02-23 13:44 出处:网络
I do not want to use jquery lazyload. because I want 开发者_StackOverflow社区loading done all the pictures then show at the same time, not loading one by one.

I do not want to use jquery lazyload. because I want 开发者_StackOverflow社区loading done all the pictures then show at the same time, not loading one by one.

I know some thing like this, but how to make a judge when all the images are loaded, then remove the loading.gif? thanks.

$("div#content").prepend("<img src='../loading.gif' class='ldrgif' / >");//add a image
...//loading images in div#content
$(this).find("img.ldrgif").remove(); //remove it, how to make a judge all the images are loaded?


Here's a neat example: http://jsfiddle.net/5Y3dW/

0

精彩评论

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