synchronization of one div with another

Discussion in 'ASP .Net' started by sumit, Nov 17, 2003.

  1. sumit

    sumit Guest

    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,,,
     
    sumit, Nov 17, 2003
    #1
    1. Advertising

Want to reply to this thread or ask your own question?

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. loveNUNO
    Replies:
    2
    Views:
    949
    loveNUNO
    Nov 20, 2003
  2. K Viltersten

    <div ... /> and <div ...></div>

    K Viltersten, Mar 30, 2009, in forum: ASP .Net
    Replies:
    4
    Views:
    778
  3. Robert Cohen
    Replies:
    3
    Views:
    291
    Andrew Durstewitz
    Jul 15, 2003
  4. Dwayne Madsen

    Q: Div A inside Div B is larger than Div B

    Dwayne Madsen, Jun 1, 2005, in forum: Javascript
    Replies:
    1
    Views:
    209
    David Dorward
    Jun 1, 2005
  5. mscir
    Replies:
    3
    Views:
    334
    Martin Honnen
    Jun 26, 2005
Loading...

Share This Page