views:

130

answers:

1

Basically I am looking to accomplish something similar to the affect that yelp uses to have the map follow you down the page on their search results page but I'd rather have it be instantaneous rather than have it catch up a few seconds after you scroll. I also don't want to just set the position to "fixed" because I want it to scroll until it would scroll off the page, and only then become "fixed" (and likewise, if the user later scrolls back up, I want the map to become "unstuck" and scroll back down the page).

I imagine that this could be accomplished with some convoluted javascript (using "watch", etc) that detects when the map is near the top of the page and changes the CSS values appropriately, but I was hoping for a combination of relative/absolute/fixed positioned divs that obviated the need for Javascript at all.

And of course what I'd really like is a drop-in library (or jQuery plugin, etc) that does just what I am looking for, if such a thing exists. If no off-the-shelf scripts exist to do this, I'd love to hear from people with first hand experience doing or trying to do the same thing.

+1  A: 

Ok I gave up and did it the yelp way.

John