repositioning panel inside page

P

Paul Fi

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.
 

Ask a Question

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

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,769
Messages
2,569,580
Members
45,054
Latest member
TrimKetoBoost

Latest Threads

Top