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

Up vote 0 down vote favorite share g+ share fb share tw.

I'm a noob with jQuery and I know about scrollTo, but not quite how to get it to function on my site. I did a quick Google search and found lots of results, but at a glance the most reliable one (or at least most popular) currently used is this one: plugins.jquery.com/project/ScrollTo However, again, being a total noob to scripting, not exactly sure how to use it to accomplish my task. (HTML and CSS are my bag, baby).

So here's what I'm trying to do...very simple stuff I'm sure. On joelglovier.com I'm building a one page "gateway" site with links to lots of my other fun web content. I have a top navigation which simply just links to anchors further down the page.

All I want is for scrollTo to take my users down to those anchors in a nice, animated fashion. Told you this was simple! Any help appreciated on the best way to implement this, and whether there is a current standard for this type of scrollTo use (I see it everywhere nowadays).

Jquery scrollto link|improve this question asked Oct 8 '10 at 3:45JAG2007656630 98% accept rate.

Refer : .offset(), .scrollTop() , .animate() you can do some thing like $(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 it here : jsbin.com/ecaye.

– JAG2007 Oct 8 '10 at 4:06 Also, the animation looks kinda choppy when I tried it. I'm viewing from Chrome. – JAG2007 Oct 8 '10 at 4:06 I haven't experience any choppiness while running on chrome!

– Avinash Oct 8 '10 at 4:10 Maybe it has to do with how I put it in. I added in the head, but I also have some jQuery before the end body tag. Not sure how to properly combine them though.

– JAG2007 Oct 8 '10 at 4:12 just checked your page. Lol, you have copied the above code as it is. Un wrap the code from anonymous function, i.e.

, just remove $(function(){ part. – Avinash Oct 8 '10 at 4:17.

I cant really gove you an answer,but what I can give you is a way to a solution, that is you have to find the anglde that you relate to or peaks your interest. A good paper is one that people get drawn into because it reaches them ln some way.As for me WW11 to me, I think of the holocaust and the effect it had on the survivors, their families and those who stood by and did nothing until it was too late.

Related Questions