如何使用jQuery创建进度条以加载图像? [英] How to use jquery to create progress bar for loading an image?

查看:172
本文介绍了如何使用jQuery创建进度条以加载图像?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我想在第一个加载页面上获取页面中图像字节的大小,然后创建一个加载栏,并显示它加载类似的Flash预加载器。但是我不知道jQuery是否可以采用图像字节大小。

I want to take size in bytes of image in page at the first load page, and then create a loading bar and show it loading similar preloader of flash. But I don't know if jQuery can take size in bytes of image or not.

推荐答案

我认为所有这些答案都需要服务器端来确定文件大小(如果我错误),但是最好从服务器大小预加载大小,或者执行AJAX请求确定文件大小,但后者似乎适得其反。

I think all of these answers require something server-side to determine the file-size (please correct me if I'm wrong), but it would probably be best to preload the size from server-size or do an AJAX request to determine the file-size, but the latter seems counter productive.

这篇关于如何使用jQuery创建进度条以加载图像?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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