The forums ran from 2008-2020 and are now closed and viewable here as an archive.

Home Forums JavaScript [Solved] animated page scroll

  • This topic is empty.
Viewing 3 posts - 1 through 3 (of 3 total)
  • Author
  • #30185

    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

    My page is here

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


    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.


    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)
  • The forum ‘JavaScript’ is closed to new topics and replies.