SitePoint Sponsor

User Tag List

Results 1 to 3 of 3

Hybrid View

  1. #1
    SitePoint Member
    Join Date
    Jul 2011
    Posts
    6
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Using the_window.scroll function, how would I...

    Site is: www.mortgage-therapist.com

    When a user clicks on any of the menu items, the selected div and its content move to the top of the page. How would I limit this from traveling all of the way to the top, stopping the content in the center of the page, or 1/4 from the top?

    Any ideas are appreciated, community!

  2. #2
    SitePoint Member
    Join Date
    Oct 2011
    Location
    Melbourne, AU
    Posts
    3
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    http://www.learningjquery.com/2007/0...with-jquery-12

    ..if you want to scroll to a position 30 pixels above the target id, you can do so simply by subtracting 30 from $target.offset().top:

    var targetOffset = $target.offset().top - 30;

  3. #3
    SitePoint Member
    Join Date
    Jul 2011
    Posts
    6
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    krang_, your input is as important to me as the entire realm of poetry (very dear to me). You've made my day. Thanks, partner.

    And I appreciate the swift response. Only getting to this now!

    If you appreciate such things: http://webstersdemise.blogspot.com/2...ofreading.html


Tags for this Thread

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
  •