zoukankan      html  css  js  c++  java
  • 记录DIV中滚动位置刷新页面位置保持不变

    一、js部分:

    <script type="text/javascript">
            $(document).ready(function () {
                $("#scroll").scroll(function () {
                    Form1.divScrollValue.value = $("#scroll").scrollTop();
                });
            });
            function ScrollToSelectNode() {
                document.getElementById("scroll").scrollTop = "<%=ScrollValue%>";
            }

    </script>

    二、HTML部分

    <body onload="ScrollToSelectNode()">

    <input runat="server" id="divScrollValue" type="hidden" value="" />

       <div class="air_1_2_1_2">
                <div class="air_1_2_1_2_1">摄像相列表</div>
                <div class="air_1_2_1_2_2" id="scroll">
                    <TABLE id="CameraTable" cellSpacing="0" cellPadding="0" width="100%" border="0" runat="server"></TABLE>
                </div>
          
           </div>

    </body>

    三、C#后台:

      public static string ScrollValue = string.Empty;//滚动条位置 

     protected void Page_Load(object sender, EventArgs e)
            {
                ScrollValue = divScrollValue.Value;

            }

  • 相关阅读:
    json.stringify()和json.parse()
    C# 对json对象嵌套数组
    sql 时间段内没有的数据等于0
    epoint:TreeView
    Asp.Net使用org.in2bits.MyXls.dll操作excel的应用
    VS中的生成事件
    mysql主从复制
    mysql索引优化分析
    MySQL逻辑架构简介
    大数据DMP画像系统(转载 简介-龙果学院)
  • 原文地址:https://www.cnblogs.com/lichengcai/p/4452455.html
Copyright © 2011-2022 走看看