搞清楚时加载的图像,他们使用的是jQuery.load插入后(“url.html”) [英] Figuring out when images are loaded after they are inserted using jQuery.load('url.html')

查看:112
本文介绍了搞清楚时加载的图像,他们使用的是jQuery.load插入后(“url.html”)的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

目前,我有一些类似的,它加载目标网页,有图像,它在一个div。

I currently have something similar to this, it loads a div on the target page that has images in it.

$('a.galleryNext').click(function(){
    // chnage the image to loading
    $("#info").html("LOADING");
    $("#currentGal").load("gallery.php div#gallery"+currentgallery, function(){
        //this fires much too early, the images are still loading...
        $("#info").html("DONE");
    });
});

我无法弄清楚是如何#info变成东西在DIV完成加载(发生后负荷返回HTML)的影像后,其他人。有没有办法做到这一点?

What I cannot figure out is how to change #info into something else after the images in the div are done loading (which happens after the load returns the html). Is there a way to do this?

推荐答案

这正是你需要的。我用它所有的时间在工作负载巨大的地图,它很容易使用。

This is exactly what you need. I use it all the time at work for loading huge maps and its really easy to use.

http://jqueryfordesigners.com/image-loading/

这篇关于搞清楚时加载的图像,他们使用的是jQuery.load插入后(“url.html”)的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆