带有重新设置到右侧表的位置,应该向上/向下滚动左侧表 [英] with respet to righthand side table, lefthand side table should be scrolled up/down

查看:142
本文介绍了带有重新设置到右侧表的位置,应该向上/向下滚动左侧表的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述


我正在使用Visual Studio 2005.2并排放置表格.现在我的要求是,当我向上/向下滚动右侧表格时,然后自动将其重复显示到右侧表格,左侧表格应向上/向下滚动.以上问题.



谢谢,
Manushi

Hi,
I am using visual studio 2005.2 tables are placed side by side.Now my requirement is when i scroll up/down the righthand side table then automatically with respet to righthand side table, lefthand side table should be scrolled up/down.Kindly help for the above issue.



Thanks,
Manushi

推荐答案

检查 ^ ]
将两个表都放在div中并使用div属性,也可以使用asp:panel.
check here[^]
Place both the tables in a div and use div properties or you can use asp:panel.


我得到的解决方案可以通过将每个表都放入div并处理onscroll事件来实现.右边的div滚动另一个div,不要忘记两个表必须具有相同的高度,如果不将两个表放在同一个div中,并使该div的溢出样式属性自动...

第一种情况:

< div id ="divLeft"; style ="height:250px; overflow:auto">

< table>

..

..

</table>

</div>

< div id ="divRight"; style ="height:250px; overflow:auto" onscroll =" scrollLeftTable()">

< table>

..

..

</table>

</div>

函数scrollLeftTable(){

document.getElementById("divLeft").scrollTop = document.getElementById("divRight").scrollTop;

}

第二种情况:




< div style =" height:250px; overflow:auto">

< table>

..

..

</table>

< table>

..

..

</table>

</div>
I got the solution one can do the same by putting every table into div and handle onscroll event for right side div to scroll the other div, dont forget that both of tables must have the same height, if not put the two tables in the same div and make the overflow style attribute for that div to auto...

first scenario :

<div id="divLeft" style="height:250px;overflow:auto">

<table>

..

..

</table>

</div>

<div id="divRight" style="height:250px;overflow:auto" onscroll="scrollLeftTable()">

<table>

..

..

</table>

</div>

function scrollLeftTable(){

document.getElementById("divLeft").scrollTop = document.getElementById("divRight").scrollTop;

}

second Scenario :




<div style="height:250px;overflow:auto">

<table>

..

..

</table>

<table>

..

..

</table>

</div>


这篇关于带有重新设置到右侧表的位置,应该向上/向下滚动左侧表的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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