views:

992

answers:

3

How can I make a div element move up and down the page when the user is scrolling the page? (where that element is always visible)

+1  A: 

Set in css position:fixed. See in W3S.

egon
+3  A: 

You want to apply the fixed property to the position style of the element

position:fixed;

What browser are you working with? Not all browsers support the fixed property. Read more about who supports it, who doesn't and some work around here

http://webreflection.blogspot.com/2009/09/css-position-fixed-solution.html

Bob
Beware that position:fixed is not working in IE6 and smaller
Residuum
STOP SUPPORTING IE6
Jason
@Jason, as much as I whole-heartedly agree with the sentiment, in the Corporate environment it may not be an option. Some companies can't/won't upgrade for a variety of reasons (like being held technologically hostage by a vendor... another story for another time). If s/he needs to support it then s/he needs to support it.
AnonJr
+1  A: 

You might want to check out Remy Sharp's recent article on fixed floating elements at jQuery for Designers, which has a nice video and writeup on how to apply this effect in client script

Russ Cam