SitePoint Sponsor

User Tag List

Results 1 to 3 of 3
  1. #1
    SitePoint Evangelist webchalkboard's Avatar
    Join Date
    Jan 2005
    Location
    Bristol, UK
    Posts
    494
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Smooth Scrolling the page with Javascript

    Hi,

    Can anyone tell me how I can smoothly scroll the page down to a specified place using javascript?

    I could use <a href="#location">click here to go to location</a>


    blah
    blah...

    <div id="location">
    this is my stuff to jump to
    </div>

    But I want it to scroll smoothly like Facebook does...

    Thanks,
    Tom
    Websites for Sale - Sell websites in a purpose built marketplace
    Then do some Shopping

  2. #2
    SitePoint Guru
    Join Date
    Sep 2006
    Posts
    731
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Quote Originally Posted by webchalkboard View Post
    Hi,

    Can anyone tell me how I can smoothly scroll the page down to a specified place using javascript?

    I could use <a href="#location">click here to go to location</a>


    blah
    blah...

    <div id="location">
    this is my stuff to jump to
    </div>

    But I want it to scroll smoothly like Facebook does...
    Well there's this effort that provides a linear scroll, which could be a bit tedious on long documents:
    It seems not to support specifying elements other than anchors.

    Then there's SoftScroll, which performs a 'decelerating' scroll.
    Tab-indentation is a crime against humanity.

  3. #3
    SitePoint Evangelist webchalkboard's Avatar
    Join Date
    Jan 2005
    Location
    Bristol, UK
    Posts
    494
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Ok thanks the soft scroll looks very good.
    Websites for Sale - Sell websites in a purpose built marketplace
    Then do some Shopping


Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •