samedi 8 août 2015

How can I account for fixed pos. overlay on page down?

Say I have a navbar div, which is at a fixed position at the top of the page, and the rest of the web page scrolls up beneath it.

How can I tell the page that when the user presses Page Down or the spacebar to scroll down one page height, that the distance that the page scrolls takes into account the visible content area, so that the first sentence of the next “page” doesn't end up hidden under the navbar. That is, I want it to scroll (pseudocode) browser_height - height_of_navbar

A simpler CSS solution would be preferred, if possible, but I'm open to a JavaScript solution, if that's what it takes.




Aucun commentaire:

Enregistrer un commentaire