简体   繁体   English

如何在仍使用jQuery加载的图像中添加加载文本/图像?

[英]How can I add loading text/image to images that are still loading with jQuery?

我需要将此应用到由jQuery选择器选择的图像,例如$(“ img”),应将其应用到页面中的所有图像。

I guess you can do like this. 我想你可以这样。

create an initial layout with the following: 使用以下内容创建初始布局:

  1. Image that you are loading with visibility:hidden; 您正在加载的具有可见性的图片:隐藏;

  2. div with loading message. div与加载消息。

  3. jQuery's domready show the image and hide the div. jQuery的domready显示图像并隐藏div。

Is this okay? 这个可以吗?

There is a tutorial at 有一个教程

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

that you would want to supplement with an each() loop in $("img") 您想在$(“ img”)中的each()循环中进行补充

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

相关问题 如何使用jQuery添加加载图像? - How to add loading image using jquery? jQuery Ui对话框-在对话框内容仍在加载时添加“正在加载”图像 - jQuery Ui Dialog - Add “Loading” image while the dialog content is still loading 如何隐藏jquery中的文本框以进行初始加载? - How can I hide the text box in jquery for initial loading? 动态加载完成后,如何使用jquery添加类? - How can I add a class with jquery once dynamic loading is finished? 如何在jQuery中添加加载? - How to add loading in jquery? 如果$(document).not-ready()? 如何检查页面是否仍在使用Jquery加载? - if $(document).not-ready()? How can I check if the page is still loading with Jquery? 如何在JQuery中显示加载图像? - How do I show a loading image in JQuery? 如何使用 js 或 jquery 将图像的“src”标签修改为 data-src 以启用延迟加载图像 - How can modify the "src" tag of an image to data-src with js or jquery in order to enable lazy loading images 如何延迟图像的加载,以便可以在加载图像之前2或3秒钟显示loading.gif? (使用jQuery / javascript) - How do I delay the loading of an Image, so that i can display a loading.gif for 2 or 3 seconds before the image loads? (using jQuery/javascript) 如何使用jQuery Image Gallery插件加载本地映像 - How to load loading local images using jQuery Image Gallery plugin
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM