Chaim
Chaim

Reputation: 2149

Jquery scrollTo Plugin: Scroll to an anchor

I'm using the scrollTo plugin (http://flesler.blogspot.com/2007/10/jqueryscrollto.html) to scroll to a specific anchor in my page. Now I would like to be able to specify an anchor to scroll to, so I tried this:

$('a[name="anchorname"]').scrollTo();

But that doesn't seem to work. Does anyone know how to do this?

Upvotes: 2

Views: 1283

Answers (1)

Matt Ball
Matt Ball

Reputation: 359776

I'm pretty sure you're looking for

$.scrollTo('a[name="anchorname"]');

Demo: http://jsfiddle.net/mattball/davUw/

Upvotes: 2

Related Questions