Jquery BlockUI - Wait for images before unblocking on ajax load

I'm using the BlockUI jquery plugin to show a loading message in a div until the content is loaded using JQuery's load method. The problem is, the content I'm pulling in contains images. The load callback fires before the images are fully loaded and the div is unblocked too early. Is there a way I can wait for all the images to load before BlockUI unblocks the div? Alternatively, if I can override the unblocking I can do the following, using the [waitForImages plugin][1] $('#mydiv').block({ message: 'Loading' }); $('#mydiv').load('ajax.php', function() { $('#mydiv').waitForImages(function() { $('#mydiv').unblock(); }); }); [1]: https://github.com/alexanderdickson/waitForImages

以上就是Jquery BlockUI - Wait for images before unblocking on ajax load的详细内容,更多请关注web前端其它相关文章!

赞(0) 打赏
未经允许不得转载:web前端首页 » jQuery 答疑

评论 抢沙发

  • 昵称 (必填)
  • 邮箱 (必填)
  • 网址

前端开发相关广告投放 更专业 更精准

联系我们

觉得文章有用就打赏一下文章作者

支付宝扫一扫打赏

微信扫一扫打赏