【问题标题】:nicescroll activates scroll after the page scroll completesnicescroll 在页面滚动完成后激活滚动
【发布时间】:2013-04-03 17:42:03
【问题描述】:

我有一个 aspx 页面。在该页面中,我为 div 应用了 nicescroll 以垂直滚动。但是 nicescroll 只有在索尼爱立信移动 android 版本 4.2 中页面的本机滚动完成后才会滚动 div。我希望 div 先滚动,然后再滚动页面。

这是我在 aspx 页面中的 div 标签。

      <div id="divexample">                                                    
          <div class="row-fluid white-bg">
               <div class="row-fluid"><b>
                    <asp:Label ID="lblcode" runat="server" Text="Using this card?" CssClass="modalLabel"></asp:Label></b>
               </div>
               <div class="row-fluid">
                    <asp:Label ID="lblcode2" runat="server" Text="Here are the instructions" CssClass="modalText modalLabeltext"></asp:Label>
                </div>
               <div class="row-fluid center">
                    <asp:Image ID="Image5" runat="server" ImageUrl="card.gif" />
               </div> 
          </div>                                                 
      </div>

head 标签内的调用部分是

    <script type="text/javascript">
            $(document).ready(
               function () {
                  $("#divexample").niceScroll({ nativeparentscrolling: "false", touchbehavior: "true" });
               }
            );
    </script>

我的 CSS 是

 <style type="text/css">
         #divexample
        {
            overflow:auto;
            height: 300px;
        }
 </style>

请帮我解决这个问题。我在这个问题上苦苦挣扎了两个星期。我找到了几种替代方法来解决这个问题,但我没有解决这个问题。如果有人修复了,那就太好了

【问题讨论】:

    标签: javascript jquery css scrollbar


    【解决方案1】:

    试试这个代码:

    $("#divexample").bind("mousedown,touchstart",function (e) {
        e.stopPropagation(); 
    });
    

    【讨论】:

    • 抱歉延迟回复。因为,我正在另一个我没有尝试过的项目中工作。今天我尝试了上面提到的代码。但我没有得到滚动条。以前至少我有滚动条,但现在我没有滚动条。首先,我放置了您提供的唯一代码。但没有得到工作。然后我放置了$("#divexample").niceScroll({ nativeparentscrolling: "false", touchbehavior: "true" });$("#divexample").bind("mousedown,touchstart",function (e) { e.stopPropagation(); }); 现在我也没有得到它的工作。这是对的吗?请帮我克服这个问题。谢谢。
    猜你喜欢
    • 1970-01-01
    • 2017-06-03
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2013-09-26
    • 1970-01-01
    • 1970-01-01
    • 2012-12-28
    相关资源
    最近更新 更多