今天因為這個問題困擾了很久網上的例子都嘗試沒效果,後來發現一點原來是內容最外層沒有div的原因
<%@ Page Language="C#" AutoEventWireup="true" CodeBehind="SpotChkDetail.aspx.cs" Inherits="Topevery.DUM.Web.Observer.SpotChkDetail" %> <script runat="server"> protected override bool HeaderScriptFilter(Topevery.Framework.Web.Configuration.Script val) { switch (val.Key) { case "ajaxpro2.prototype": case "ajaxpro2.core": case "ajaxpro2.converter": case "ajaxpro2.onloading": case "ajaxpro2.assembly.AjaxFunction": case "my97": case "image": case "jquery.pagination": case "jquery.jqGrid.locale": case "jquery.jqGrid": case "jquery-load-image": case "jquery.validationEngine": case "jquery.validationEngine-zh": case "WeiBo": case "jquery.mousewheel": case "jquery.iviewer": case "jquery.gallery.singer": return true; default: return base.HeaderScriptFilter(val); } } protected override bool HeaderStyleFilter(Topevery.Framework.Web.Configuration.Style val) { switch (val.Key) { case "jqgrid": case "jqgrid-grey": case "validationEngine": return true; default: return base.HeaderStyleFilter(val); } } </script> <!DOCTYPE html> <html xmlns="http://www.w3.org/1999/xhtml"> <head runat="server"> <meta http-equiv="Content-Type" content="text/html; charset=utf-8" /> <title></title> </head> <body id="bbdy"> <form id="form1" runat="server"> <div> <div class="TUI-layout-north"> <div class="TUI-title"> <span class="TUI-ico ico-note"></span><strong>抽查</strong> </div> <div class="" style="float: right; margin-top: -30px; z-index: 99999; position: relative;"> <object id="WebBrowser" classid="CLSID:8856F961-340A-11D0-A96B-00C04FD705A2" height="0" width="0"> </object> <input type="button" class="TUI-button" value="打 印" onclick="document.all.WebBrowser.ExecWB(6, 1)" id="Button2" /> <input type="button" class="TUI-button" value="打印預覽" onclick="document.all.WebBrowser.ExecWB(7, 1)" /> </div> <div class="TUI-alert"> <span class="ml10px">抽查時間:<asp:Label ID="lbBeginDate" runat="server" Text="Label"></asp:Label> 失效時間:<asp:Label ID="lbEndDate" runat="server" Text="Label"></asp:Label> 消息內容:<asp:Label ID="lbContent" runat="server" Text="Label"></asp:Label></span> <div style="display: none"> <asp:Button ID="btnRef" runat="server" OnClick="btnRef_Click" Text="刷新" /> </div> </div> </div> <div class="TUI-layout-center"> <div class="TUI-content TUI-h100 TUI-of-auto TUI-align-center"> <asp:Repeater ID="Repeater1" runat="server" OnItemDataBound="Repeater1_ItemDataBound"> <%--OnItemCommand="Repeater1_ItemCommand"--%> <HeaderTemplate> <table class="TUI-grid-list w100" id="observers"> <tr> <th style="width: 150px">巡查員頭像 </th> <th style="width: 80px">姓 名 </th> <th style="width: 120px">是否超時 </th> <%--<th style="width: 110px">城管通號碼 </th> <th style="width: 110px">城管通版本 </th>--%> <th style="width: 100px">消息狀態 </th> <th style="width: 100px">審核狀態 </th> <th style="width:150px">審核 </th> </tr> </HeaderTemplate> <ItemTemplate> <tr class="people_title_td"> <td rowspan="2" valign="middle" style="width: 110px"> <img id="img_observer_poto" runat="server" height="135" style="border: 1px solid #bababa;" width="100" /> </td> <td style="width: 60px"> <%# Eval("c_name")%> <asp:HiddenField ID="hfObId" runat="server" Value='<%# Eval("c_ob_id") %>' /> <asp:HiddenField ID="hfId" runat="server" Value='<%# Eval("c_id") %>' /> </td> <td style="width: 100px"> <%# Eval("c_is_over_time")%> </td> <%--<td style="width: 110px"> <%# Eval("c_pda_number")%> </td> <td style="width: 110px"> <%# Eval("c_pda_version")%> </td>--%> <td style="width: 90px"> <%# Eval("notify_state")%> </td> <td style="width: 90px"> <%# Eval("eligible_state")%> </td> <td style="width:150px;"> <div style="display:<%# Eval("c_is_eligible").ToString() !="0"?"none":"" %>"> <%--<asp:LinkButton ID="LinkButton1" runat="server" CommandName="lnk_poto" CommandArgument='<%# Eval("c_id") %>'>重攝</asp:LinkButton> <asp:LinkButton ID="LinkButton2" runat="server" CommandName="lnk_ok" CommandArgument='<%# Eval("c_id") %>'>合格</asp:LinkButton> <asp:LinkButton ID="LinkButton3" runat="server" CommandName="lnk_no" CommandArgument='<%# Eval("c_id") %>'>不合格</asp:LinkButton>--%> <a href='#' onclick='review(<%# Eval("c_id") %>,0,"重攝")' class='TUI-toolbar-btn'><span></span>重攝</a> <a href='#' id="qualified" onclick='review(<%# Eval("c_id") %>,1,"合格")' class='TUI-toolbar-btn'><span></span>合格</a> <a href='#' id="Unqualified" onclick='review(<%# Eval("c_id") %>,2,"不合格")' class='TUI-toolbar-btn'><span></span>不合格</a> </div> </td> </tr> <tr class="alt_tr2"> <td colspan="5" style="height: 160px; text-align: left"> <table class="choucha-table"> <tr> <asp:Repeater ID="rptImg" runat="server"> <ItemTemplate> <td> <div class="div_img TUI-notelist-container TUI-gallery choucha-img"> <div id='imge'+'<%#Eval("FileId") %>'> <div class="TUI-gallery-content TUI-gallery-img"> <a title='點擊放大' href="javascript:void(0)" sourceSrc='<%#Eval("Imageurl") %>' largeSrc='<%#Eval("Imageurl") %>'><img src='<%#Eval("Imagethumbil") %>' /><span><%#Eval("Summary") %></span></a> </div> </div> </div> </td> </ItemTemplate> </asp:Repeater> </tr> </table> </td> </tr> </ItemTemplate> <FooterTemplate> </table> </FooterTemplate> </asp:Repeater> <input type="hidden" id="hdnvalue" runat="server" value="0" /><!----存放scorllTop值--> </div> </div> </div> <script type="text/javascript"> $(document).ready(function () { TUILayout("form"); //LoadImage(); $(".div_img").gallery({ gallerySize: { width: 90, height: 120 }, fullView: "true" //ture為允許點擊圖像全屏浏覽 }); }); function LoadImage() { var jq_o_list = $("#observers div[@ref_id]"); for (var i = 0 ; i < jq_o_list.length; i++) { load_to(jq_o_list[i]); } } function load_to(obj) { var jq_o = $(obj); Topevery.DUM.Web.AjaxFunction.GetEvtDefault(jq_o.attr("ref_id"), function (ajaxResult) { var val = ajaxResult.value; jq_o.empty(); jq_o.append(val.Html); }); } //$("#div_evt_img").gallery({ // images: evt_img_list, // thumbSize: { width: 65, height: 60 },//縮略圖大小 // gallerySize: { width: 380, height: 280 },//畫廊圖(中間大圖)大小 // thumbDisplayNum: 4,//縮略圖顯示數量 // scalingSize: { width: 360, height: 260 },//畫廊圖(中間大圖)自動比例縮放最大大小 // fullView: "true" //ture為允許點擊圖像全屏浏覽 //}); function Reminder() { NotSelectEvt("已經再次發送消息通知巡查員!"); } function review(id, type, content) { if (confirmL("確認" + content + "嗎?", function () { Topevery.DUM.Web.AjaxFunction.ReviewImg(id, type); $("#btnRef").click(); })) { } } </script> </form> </body> </html> <script type="text/javascript"> window.onbeforeunload = function () { var scrollPos; if (typeof window.pageYOffset != 'undefined') { scrollPos = window.pageYOffset; } else if (typeof document.compatMode != 'undefined' && document.compatMode != 'BackCompat') { scrollPos = document.documentElement.scrollTop; } else if (typeof document.body != 'undefined') { scrollPos = document.body.scrollTop; } document.cookie = "scrollTop=" + scrollPos; //存儲滾動條位置到cookies中 } window.onload = function () { if (document.cookie.match(/scrollTop=([^;]+)(;|$)/) != null) { var arr = document.cookie.match(/scrollTop=([^;]+)(;|$)/); //cookies中不為空,則讀取滾動條位置 document.documentElement.scrollTop = parseInt(arr[1]); document.body.scrollTop = parseInt(arr[1]); } } </script>
以上就是本文的全部內容,希望對大家有所幫助,同時也希望多多支持!