repositioning panel inside page

Discussion in 'ASP .Net' started by Paul Fi, Nov 17, 2004.

  1. Paul Fi

    Paul Fi Guest

    when i scroll up and down a page i want the panel inside to move as well
    so that it doesnt disppear when scrolling the page:

    now i have this javascript code, that does that, but it's not so smooth:

    prevScroll = 0;

    function scroll(){

    var displayFrame = document.all("ifrmDisplay");
    amountToScroll = window.document.body.scrollTop - prevScroll;
    document.getElementById("pnlControlsContainer").style.top =
    parseInt(document.getElementById("pnlControlsContainer").style.top) +
    parseInt(amountToScroll);
    document.getElementById("imgShopLogo").style.top =
    ;//parseInt(document.getElementById("imgShopLogo").style.top) +
    parseInt(amountToScroll);
    prevScroll = window.document.body.scrollTop;
    }

    now from the code, the panel's id is pnlControlsContainer, and im
    changing the top attribute of the panel so i can make that panel move
    with page scroll when the eventhandler (scroll()) is called. But it
    doesnt produce smooth results as the top of the panel looks stammer or
    it keeps bouncing up and down like when im scrolling the page.

    if you guys know of a smoother result, i will appreciate it.



    *** Sent via Developersdex http://www.developersdex.com ***
    Don't just participate in USENET...get rewarded for it!
     
    Paul Fi, Nov 17, 2004
    #1
    1. Advertisements

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. HS1
    Replies:
    3
    Views:
    675
  2. HS1
    Replies:
    4
    Views:
    8,564
    Babu Kalakrishnan
    Dec 8, 2004
  3. Neil Greenough

    Repositioning

    Neil Greenough, Aug 29, 2004, in forum: HTML
    Replies:
    11
    Views:
    884
  4. pete

    Repositioning controls on a web page

    pete, Jul 29, 2003, in forum: ASP .Net Web Controls
    Replies:
    1
    Views:
    169
    Alvin Bruney
    Jul 30, 2003
  5. Hein de Ruyter

    Repositioning HTML-table after post

    Hein de Ruyter, Aug 31, 2005, in forum: ASP .Net Web Controls
    Replies:
    3
    Views:
    605
    Steven Cheng[MSFT]
    Sep 2, 2005
  6. Lee

    problem repositioning control at runtime (c#)

    Lee, Jun 28, 2006, in forum: ASP .Net Web Controls
    Replies:
    0
    Views:
    181
  7. Kor
    Replies:
    6
    Views:
    179
  8. Mark
    Replies:
    0
    Views:
    141
Loading...