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. 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. Vidar Petursson

    Re: Image Repositioning in ASP.NET

    Vidar Petursson, Jun 4, 2004, in forum: ASP .Net
    Replies:
    0
    Views:
    385
    Vidar Petursson
    Jun 4, 2004
  2. HS1
    Replies:
    3
    Views:
    499
  3. HS1
    Replies:
    4
    Views:
    8,322
    Babu Kalakrishnan
    Dec 8, 2004
  4. Neil Greenough

    Repositioning

    Neil Greenough, Aug 29, 2004, in forum: HTML
    Replies:
    11
    Views:
    752
  5. pete

    Repositioning controls on a web page

    pete, Jul 29, 2003, in forum: ASP .Net Web Controls
    Replies:
    1
    Views:
    115
    Alvin Bruney
    Jul 30, 2003
Loading...

Share This Page