Friday, September 28, 2007

Move Div Vertical ScrollBar Simultaneously

To Make Div To Overflow i had created such Space Between <pre> </pre> tags

<html xmlns="http://www.w3.org/1999/xhtml">
<head id="Head1" >
<title>Move Div Vertical ScrollBar Simultaneously</title>
<script language="javascript">
function divScrollR()
{
var Right = document.getElementById('Av');
var Left = document.getElementById('Bv');
Left.scrollTop = Right.scrollTop;
}

function divScrollL()
{
var Right = document.getElementById('Av');
var Left = document.getElementById('Bv');
Right.scrollTop = Left.scrollTop;
}
</script>

</head>
<body>
<form id="form1" runat="server">
<div>
<div id="Av" style="z-index: 102; width: 100px; height: 100px; overflow: auto;
overflow-x: hidden; overflow-y: scroll; left: 10px; position: absolute; top: 16px;" onscroll="divScrollR();">
<pre>













</pre>
</div>
<div id="Bv" style="z-index: 101; top: 16px; width: 100px; height: 100px; overflow: auto;
overflow-x: hidden; overflow-y: scroll; left: 113px; position: absolute;" onscroll="divScrollL();">
<pre>













</pre>
</div>
</div>
</form>
</body>
</html>






Program Demo

No comments: