Often times you’ll have be playing, say, videos with a list of videos down the page. If the list gets too long the video player becomes out of sight as the user scrolls down. This can be a big confuser to users: they click on a link to see a video and they don’t see anything happen because the video player is out of sight. Here’s what you can do: scroll to the video player if it is out of sight like so:
if ($("videoplayer").viewportOffset()[1] < 0) {
Effect.ScrollTo('videoplayer', {duration: 0.2});
}
Requires both prototype and effects.js in scriptaculous.

Activity
Geir Freysson
Andrew DiFiore
zeming
Arun, Neil, shashwat
Eric, Fernando Zanatta, Jörn Zaefferer