How do I implement jQuery scrollTo for links on the same page? -


i'm noob jquery , know scrollto, not quite how function on site. did quick google search , found lots of results, @ glance reliable 1 (or @ least popular) used one: http://plugins.jquery.com/project/scrollto

however, again, being total noob scripting, not sure how use accomplish task. (html , css bag, baby).

so here's i'm trying do...very simple stuff i'm sure.

on http://joelglovier.com i'm building 1 page "gateway" site links lots of other fun web content. have top navigation links anchors further down page. want scrollto take users down anchors in nice, animated fashion. told simple!

any appreciated on best way implement this, , whether there current standard type of scrollto use (i see everywhere nowadays).

refer : .offset(), .scrolltop() , .animate()

you can thing

$(function() {     $('#nav-find-me-at a').click(function() {         var pos = $('#find-me-at').offset().top;         $('html, body').animate({'scrolltop' : pos}, 1000);             return false;     }); }); 

edit : test here : http://jsbin.com/ecaye


Comments

Popular posts from this blog

ASP.NET/SQL find the element ID and update database -

jquery - appear modal windows bottom -

c++ - Compiling static TagLib 1.6.3 libraries for Windows -