Velocity Reviews

Velocity Reviews (http://www.velocityreviews.com/forums/index.php)
-   ASP .Net (http://www.velocityreviews.com/forums/f29-asp-net.html)
-   -   synchronization of one div with another (http://www.velocityreviews.com/forums/t66879-synchronization-of-one-div-with-another.html)

sumit 11-17-2003 04:07 PM

synchronization of one div with another
 
Hi,
My requirment is to synhcronize scrolling of two divs,,
If I scroll one unit the other div should also get
scrolled by one unit,,
For this I have written a javascript func ScrollUpper()
which is called on onScroll() event of first div,,
DivRealMedia is first div id
DivDummy is second div id
function is:
function ScrollUpper()
{
if (DivRealMedia.scrollLeft == 0 ||
DivRealMedia.scrollLeft == prevLeft)
{
prevLeft = DivRealMedia.scrollLeft;
}
else
{
if (DivRealMedia.scrollLeft < prevLeft)
{
prevLeft = DivRealMedia.scrollLeft;
DivDummy.doScroll("scrollbarLeft");
}
if (DivRealMedia.scrollLeft > prevLeft)
{
prevLeft = DivRealMedia.scrollLeft;
DivDummy.doScroll("scrollbarRight");
}
}
}

But It is not synchronized as required. DivDummy should
move with same unit as that of DivRealMedia.

Please suggest me how it can be achieved!!

Thanks,,,


All times are GMT. The time now is 01:24 PM.

Powered by vBulletin®. Copyright ©2000 - 2013, vBulletin Solutions, Inc.
SEO by vBSEO ©2010, Crawlability, Inc.


1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57