S
sumit
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,,,
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,,,