【发布时间】:2012-12-27 08:49:47
【问题描述】:
当图像加载时,我现在正在通过我的模板加载所有图像
//For example, I will just pass the image url into the tempate when the page renders
%div{class: "img_container <%= answer.image_scale %> <%=answer.show_image%>"}
<% if (media_con.standard_resolution) { %>
%a.fancy{href: "<%= media_con.standard_resolution %>"}
%img{src: "<%=media_con.standard_resolution%>"}
我意识到这样做(尤其是当我在页面上加载许多图像时)会导致效率低下,尤其是在移动网络上。
如何仅在视图中加载图像(滚动),也许只是加载缩略图并在带有图像的视图出现时加载实际图像。
这里的任何建议表示赞赏
【问题讨论】:
标签: image performance backbone.js load haml