SitePoint Sponsor

User Tag List

Results 1 to 4 of 4
  1. #1
    SitePoint Member
    Join Date
    Jul 2012
    Posts
    5
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Horizontal scrolling problem

    I was following this tutorial to build horizontal scrolling site:

    http://www.sitepoint.com/side-scroll.../#.T_ixd460Wc8

    but discovered a scrolling problem. When the browser is shrunk to force a vertical scroll bar in the tutorial, and you click on a link, the whole body of text shifts upward. Its the same problem I'm facing in my website design.... argh

    Not sure exactly what to do. Top section (menu) is placed in "fixed" position so always stays put when scrolling weird....

    Any ideas?

  2. #2
    It's all Geek to me silver trophybronze trophy
    ralph.m's Avatar
    Join Date
    Mar 2009
    Location
    Melbourne, AU
    Posts
    23,620
    Mentioned
    413 Post(s)
    Tagged
    7 Thread(s)
    Hi nahchusdivad. Welcome to the forums.

    This seemed like a new topic, so I've moved it to a thread of its own.

    I don't get that behavior when I try to do what you describe. What browser are you using? Could you post a link to the page concerned, and specify exactly what you are seeing?

  3. #3
    SitePoint Member
    Join Date
    Jul 2012
    Posts
    5
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Hey thanks for the response,

    I'm using Google Chrome Version 20.0.1132.47. Sorry you're right I didn't see it in Demo 4, but I see it in Demo 3:

    http://s3.sitepoint.com/examples/sidescroll/demo3.html

    I haven't uploaded the page that I'm working on yet... I'll see if I can get it online soon and post it here

    Thanks again for your help

  4. #4
    SitePoint Member
    Join Date
    Jul 2012
    Posts
    5
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Oh my god I feel like an idiot that it was right there in front of my eyes.... in the <head> section there was this script:

    <script src="includes/jquery-1.5.1.min.js" type="text/javascript" charset="utf-8"></script>
    <script type="text/javascript" charset="utf-8">
    $(document).ready(function() {
    $("#banner a").bind("click",function(event){
    event.preventDefault();
    var target = $(this).attr("href");
    $("html, body").stop().animate({
    scrollLeft: $(target).offset().left,
    scrollTop: $(target).offset().top
    }, 1200);
    });
    });
    </script>

    Totally didn't see the scrollTop part. Deleted it and now it solved my problem. Thanks anyways for your help. Hopefully this will help someone for feeling to stupid for too long =P


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
  •