图片懒加载程序示例
<%@ Page Language="C#" AutoEventWireup="true" CodeFile="ImageList.aspx.cs" Inherits="weiwei_HuxingList" %> <html> <head runat="server"> <title>楼盘相册</title> <meta name="viewport" content="width=device-width, initial-scale=1.0, user-scalable=no, minimum-scale=1.0, maximum-scale=1.0" /> <link href="css/gmu.css" rel="stylesheet" type="text/css" /> <link href="css/defaultwei.css" rel="stylesheet" type="text/css" /> <link href="css/defaultnew.css" rel="stylesheet" type="text/css" /> <script src="http://ajax.googleapis.com/ajax/libs/jquery/1.10.2/jquery.min.js" type="text/javascript"></script> <script src="http://www.appelsiini.net/projects/lazyload/jquery.lazyload.js?v=1.9.0" type="text/javascript"></script> <script type="text/javascript" charset="utf-8"> $(function () { $("img.lazy").lazyload(); }); </script> </head> <body> <div class="wrapper"> <div class="box"> <!-- 收起时加上样式box_up,展开时去掉 --> <h3> <%=classname%></h3> <div class="box_time"> <asp:Repeater ID="rptImgList" runat="server"> <ItemTemplate> <div > <img class="lazy" data-original="<%# Eval("hxt_img")%>" width="100%"/> </div> <div style=" height:30px; text-align:center; background-color:#F9F9F9;"><%#Eval("hxt_name")%></div> </ItemTemplate> </asp:Repeater> </div> </div> <div class="box"> <!-- 收起时加上样式box_up,展开时去掉 --> <h3> 优惠信息</h3> <div class="box_time"> <%=New_price8000%> </div> </div> </div> <script> $(function () { $("img.lazy").lazyload(); }); </script> </body> </html>