[Greasemonkey] make browser scroll to an element

Pramod Biligiri pramodbiligiri at gmail.com
Tue May 17 02:22:50 EDT 2005


On 5/16/05, Matthew Gertner <matthew at allpeers.com> wrote:
> 
> element.scrollIntoView(false) should work.


scrollIntoView(false) makes the element come barely into focus at the bottom 
of the window, and not at the top where I want it.

I found a property called offsetTop on using the DOM Inspector on an element
so window.scrollTo(0, element.offsetTop) worked for me.

I didn't find it mentioned in the Gecko DOM Reference though.
Here's the script: 
http://blogs.applibase.net/pramod/code/delicious_addanchor.user.js
Basically provides a way of linking to individual
del.icio.us<http://del.icio.us>posts..provided this script's installed
on the end where
you want to de-reference the link too :)

Pramod Biligiri
-- 
We're hiring: 
http://blogs.applibase.net/pramod/index.php/archives/we-are-hiring
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://mozdev.org/pipermail/greasemonkey/attachments/20050517/7cfa1086/attachment.htm


More information about the Greasemonkey mailing list