如何在div中保持滚动条包含树视图控件 [英] How to maintain scroll bar in a div contains treeview control

查看:76
本文介绍了如何在div中保持滚动条包含树视图控件的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

大家好,

我有一个基于div文档加载的要求以及另一个div中的加载分隔(目录)。这里的目录被绑定到Treeview,然后我们点击treeview节点div滚动顶部。实际操作我想要点击树形视图节点,滚动保持位置。



请帮助



< b>我尝试过:



我的代码:

< div class =行> 
< div class =col-lg-3 sidenav>
< asp:linkbutton id =lbhomevisible =falserunat =servertext =Homeonclick =lbhome_Click>
< asp:treeview id =TVcontentsrunat =serveronselectednodechanged =TVcontents_SelectedNodeChangedfont-size =Small>

< / div>
< div class =col-lg-9 contentnav>
< asp:label id =marketnamerunat =serverfont-bold =truefont-size =XX-Large>
< div id =pagecontentclass =pagestylestyle =height:475px>< / div>
< / div>
< / div>



我试过MaintainScrollPositionOnPostback = true,

我试过

$( function(){

//恢复滚动位置

$(#tvDiv)。scrollTop($(#HiddenScrollTop)。val()); < br $>
$(#tvDiv)。scrollLeft($(#HiddenScrollLeft)。val());

})

$( function(){

//保存滚动位置

$(#tvDiv)。scroll(function(){

$( #HiddenScrollLeft)。val($(this).scrollLeft());

$(#HiddenScrollTop)。val($(this).scrollTop());

});

})



等等但是它们不起作用

解决方案

(function(){

//恢复滚动位置


(#tvDiv)。 scrollTop(


(#HiddenScrollTop)。val());

Hi All,
I have a requirement based on word document load in a div along with load separated (Table of contents) in another div. Here Table of contents are binded to Treeview, then we click treeview node the div scroll top. Actual action i want wherever we click treeview node the scroll maintain there position.

please help

What I have tried:

My Code:

<div class="row">
        <div class="col-lg-3 sidenav">    
            <asp:linkbutton id="lbhome" visible="false" runat="server" text="Home" onclick="lbhome_Click">
           <asp:treeview id="TVcontents" runat="server" onselectednodechanged="TVcontents_SelectedNodeChanged" font-size="Small">
                         
           </div>
        <div class="col-lg-9 contentnav">          
             <asp:label id="marketname" runat="server" font-bold="true" font-size="XX-Large">
            <div id="pagecontent" class="pagestyle" style="height: 475px"></div>             
        </div>
    </div>


I tried MaintainScrollPositionOnPostback=true,
I tried
$(function () {
//recover the scroll postion
$("#tvDiv").scrollTop($("#HiddenScrollTop").val());
$("#tvDiv").scrollLeft($("#HiddenScrollLeft").val());
})
$(function () {
//save the scroll position
$("#tvDiv").scroll(function () {
$("#HiddenScrollLeft").val($(this).scrollLeft());
$("#HiddenScrollTop").val($(this).scrollTop());
});
})

and so many but they didn't work

解决方案

(function () {
//recover the scroll postion


("#tvDiv").scrollTop(


("#HiddenScrollTop").val());


这篇关于如何在div中保持滚动条包含树视图控件的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆