如何在用户滚动图像时仅加载图像 [英] How do I only load an image when the user scrolls to it

查看:99
本文介绍了如何在用户滚动图像时仅加载图像的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

许多网站似乎只下载图片或生成文档的一部分(例如用于评论),当用户向下滚动页面足够实际看到它们时。

Many sites appear to only download images or generate parts of the document (eg for reviews) when the user scrolls far enough down the page to actually see them.

这显然可以为您提供更快的加载页面,并为任何不打算向下滚动的人节省带宽。

This obviously will give you faster loading pages and save on bandwidth for anyone that does not bother scrolling down.

这是如何完成的,最好是使用jquery?或者换一种方式,如何检测到丢失的图像刚刚滚动到视图中并需要获取?

How is this done, ideally with jquery? Or to ask it another way, how do I detect that a missing image has just scrolled into view and needs to be fetched?

推荐答案

有插件。 这是一个 ......

There are plugins for that. Here's one...

这篇关于如何在用户滚动图像时仅加载图像的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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