3

我使用 Display:none 移动设备方法创建了响应式设计。但是当我们使用这种方法时,元素会加载,并且会导致加载时间过长。那么有什么简单的方法可以减少加载时间。我更喜欢一些 External JS 来解决这些问题。

有谁能够帮我

4

1 回答 1

1

I'm assuming the load time is being increased by large images? One solution would be to use the Lazyload jQuery plugin which only loads images when they are within the viewport.

http://www.appelsiini.net/projects/lazyload

I'm not sure if it will still load images that are not visible. However, you could instead use a class on elements which should not be visible, and then use this to position them outside of the viewport.

EDIT: Lazyload will skip hidden images by default. (See the bottom of the page linked above)

于 2012-07-16T11:52:10.683 回答