How would I have a DIV stay at the top of the page visually as the user scrolls down a web page?
A simple Javascript framework would be great!
it's for this web site: http://BiblePro.BibleOcean.com
How would I have a DIV stay at the top of the page visually as the user scrolls down a web page?
A simple Javascript framework would be great!
it's for this web site: http://BiblePro.BibleOcean.com
If you don't care about IE6, you can use position: fixed
:
div {
top: 0;
position: fixed
}
Using jQuery, see this question: What is the simplest jQuery way to have a ‘position:fixed’ (always at top) div?
Here you go: http://net.tutsplus.com/tutorials/html-css-techniques/creating-a-floating-html-menu-using-jquery-and-css/
Ineterestingly, I have the same question, but I'm looking to re-create the Apple Store shopping cart sidebar. It works similarly, except that it swaps the CSS class of the div when a certain scroll position is reached, so it goes from absolute to fixed. Anyone know where I can find this, I've looked everywhere for a tutorial replicating the effect.