I im trying to set the position to fixed on scoll. I need it to happen without the div underneath has a position.
I created this fiddle of how i would like it to be, but without the div #body is positioned.
http://jsfiddle.net/mortenhauberg/fPTnq/embedded/result/
Is it posible?
I am new to javascript/jQuery!
I hope you understand my poor english!
Morten Hauberg
Based on your code, the class
not_fixedis applying aposition:absolutewhen the menu is within the scrollable area. But when the user scrolls the browser viewport outside the viewable area, you have script adding a css class to the<div id="menu">. Is addsfixedclass (which applies aposition:fixed). Remove thenot_fixedclass, and it will stop breaking the scroll.