I have a web page with a height more than 1000 pixels. There is an important text which I need to display all the time to a visitor. I placed a 20 pixel high DIV with a fixed property at the top of the page but the content of that DIV appears in the browser available in the middle. I want to hide the top div, but as I scrolled up from the middle div I want to show the top div.
Share
Are you looking for something like this?
Given this HTML:
You can use this JavaScript to display a div when
span#interestingis visible, and hide it when it isn’t visible:Not all of this is strictly necessary, but it looks cool.