装载机问题

发布于 2024-07-25 20:09:09 字数 184 浏览 4 评论 0原文

我想知道是否有可能有一个加载程序将运行直到页面中的所有图像都加载到页面上。 我有一个网站 http://ranjoy.athost.net/ 其中有一些 png 大尺寸图像,我希望在动画开始之前加载所有图像....请帮助

I want to know whether it is posible to have loader which will run till all the images in the page been loaded to the page . I have a website http://ranjoy.athost.net/ which is having some png large size images, i want all the images to load before the animation start .... plz help

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(2

过气美图社 2024-08-01 20:09:09

如果我理解正确,这将完成工作

$( "img" ).ready(function(){
 //code to start animation 
});

编辑:使用回调并在页面中的所有图像加载时调用。 如果您只想等到某些图像加载完毕,您可以尝试此操作

$( "img.anim" ).ready(function(){
 //code to start animation 
});

,并为所有动画图像提供这样的动画类

<img src="whatever.png" class="anim" />

If I'm understanding you right this would do the job

$( "img" ).ready(function(){
 //code to start animation 
});

edit: a callback is used and is called when all the images in the page have loaded. If you wanted to wait only until certain images have laoded you could try this

$( "img.anim" ).ready(function(){
 //code to start animation 
});

and give all your animation images a class of anim like this

<img src="whatever.png" class="anim" />
~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文