Grow your CSS skills. Land your dream job.

[Solved] animated page scroll

  • # September 7, 2010 at 2:27 pm

    I am trying to make the page scroll to the top of a div when a link is clicked. It needs to be animated to help the user understand what is going on.

    It should scroll when clicking on the buy button for the first CD “You Made Us Alive”. It should scroll to the top of the #mainContent div.

    I am using the code offered here http://flesler.blogspot.com/2007/10/jqueryscrollto.html

    My page is here http://s70539.gridserver.com/music-foxycart-version.php

    I am very new to JS and I don’t know what I am doing wrong. Any help is much appreciated.

    # September 7, 2010 at 3:05 pm

    The problem I believe is that that script is for use with jQuery, and you don’t have jQuery attached to your site. Put this line of code in your head, it links to the jquery code so it will be usable on your site.

    After you put that line of code in. Try adding the scrollTo code again. Make sure to add the scrollTo script AFTER the the above jquery one. Also, make sure your id’s and classes match properly with what scrollTo says they need to be.

    # September 7, 2010 at 3:34 pm

    I put the line in that you recommended. And checked the id’s and classes as best I know how. Still not working. Any other thoughts?

Viewing 3 posts - 1 through 3 (of 3 total)

You must be logged in to reply to this topic.

*May or may not contain any actual "CSS" or "Tricks".