Forums

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
    Posts
  • #30185
    jbope
    Participant

    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.

    #80376
    noahgelman
    Participant

    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.

    #80368
    jbope
    Participant

    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.