摘要: http://mslog.sinaapp.com/archives/33今天在博客园看了一位哥的按需加载图片博客,将代码做成一个函数封装下,直接拿来主义用在我的站上,12345678910111213141516varfn=function(){ $("img").each(function(){//遍历所有图片 varothis=$(this),//当前图片对象 top=othis.offset().top-$(window).scrollTop();//计算图片top - 滚动条top if(top>$(window).height()){//如果该图片不可见 . 阅读全文
posted @ 2014-03-13 17:27 践道者 阅读(240) 评论(0) 推荐(0) 编辑