george Posted September 14, 2011 Share Posted September 14, 2011 found my solution here. "keep element in view while scrolling" uses jQuery Link to comment Share on other sites More sharing options...
dsonesuk Posted September 14, 2011 Share Posted September 14, 2011 ??? but that what position: fixed; does, what you do have to consider is the main content should use padding to place below the fixed menu, as fixed position element does not occupy any space, so the top of content will be under or overlapping the menu. The other problem is you have to use a background-color for the menu to prevent scrolling text being viewed behind it. Also position:relative; with z-index: 1; might have to be used on content container, to place it behind the menu, which should be giving a higher z-index of z-index:10; to prevent this. Link to comment Share on other sites More sharing options...
george Posted September 14, 2011 Author Share Posted September 14, 2011 Thanks dsonesuk, What I really want is a way to turn fixed positioning on only when the screen has scrolled to a certain extent, past a given point.That is what I do not know how to do. Link to comment Share on other sites More sharing options...
Ingolme Posted September 14, 2011 Share Posted September 14, 2011 I've seen that effect in GMail. Here's how I'd implement it: With Javascript, detect the distance of the element from the top of the page and from the left of the page and save those numbers. When the scrollTop property of the window is greater or equal to the element's distance from the top of the page, then set the position to "fixed", the top to 0 and left to the distance the element is from the left of the page. Change the position back to "static" when the scrolltop property is less than the distance Link to comment Share on other sites More sharing options...
dsonesuk Posted September 14, 2011 Share Posted September 14, 2011 Hang on! everything changed new link different 1st post description????? sorry! moving goal posts is not allowed in this game Link to comment Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.