如何显示等待gif,直到图像完全加载 [英] How to display a wait gif until image is fully loaded

查看:164
本文介绍了如何显示等待gif,直到图像完全加载的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

大多数流行的浏览器在渲染图像时,会在加载时从上到下逐行显示该图像.

Most popular browsers, while rendering an image, they display it line-by-line top-to-bottom as it loads.

我有一个要求,在加载图像时应显示一个gif图像. 图像完全加载后,应显示它,而不是等待gif.

I have a requirement that a wait gif should be displayed while the image is loading. When the image is fully loaded then it should be displayed instead of the wait gif.

推荐答案

您可以使用jQuery load方法

You can use jQuery load method

您可以在这里查看:

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

这是解决方案的一种实现方式

This is one implementation of solution

这篇关于如何显示等待gif,直到图像完全加载的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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