Forums

The forums ran from 2008-2020 and are now closed and viewable here as an archive.

Home Forums CSS Hiding page content under fixed div Reply To: Hiding page content under fixed div

#256357
Beverleyh
Participant

Im not sure what you want to happen to the content box once it hits the orange header (display:none; for content doesn’t seem right to me), but have a look at the JavaScript in this article http://blog.fofwebdesign.co.uk/41-add-classes-to-an-element-when-scrolled-into-viewport

You can use it to apply a new class to the content box when it reaches the header (150px from top should do it; a combined total of the header’s height and margin-top). Then, define new styles against the new class so that the content box does whatever you want.