I would like to create a block that will scroll down the page as user scrolls down the page. My guess is that I can create a block in the admin>blocks that will follow the weights of the other blocks (this will be the "last" block.) and in the template.php setup some code that will check the location of that specific block and when the position gets to say 10px from the top of the window to set the position attributes to an absolute placement. At that point the block will always be say 10px from the top of the window.

Any ideas?

Stuart

Comments

NancyDru’s picture

it's going to take some Java scripting. But I'd like to know the correct answer too.

Nancy W.
Drupal Cookbook (for New Drupallers)
Adding Hidden Design or How To notes in your database

Anonymous’s picture

I know there's a way to do it using CSS. Something like position: absolute

See http://www.w3.org/Style/CSS/
and
http://www.w3.org/TR/CSS21/visuren.html#absolute-positioning

stuartgoff’s picture

yes that's what i think -but- it would need to change to that "absolute" attribute only after that block starts to reach the top of the page. Until then, I need the block needs to keep it's place.

NancyDru’s picture

How are you going to change it's position? You'll need a script to do that. CSS won't do it.

Nancy W.
Drupal Cookbook (for New Drupallers)
Adding Hidden Design or How To notes in your database

US421’s picture

You do need to create a new region for this block. Then you can set the positioning and have the block stay at the same place. Anybody remember the old theme garden, where the chair and the water hose were always at the bottom? I have seen this done a number of times.

Here is one I think is similar to what you are looking for: http://www.opendesigns.org/preview/?template=658