No jump form scroll bar?

Discussion in 'Web Design and Development' started by andyjamesnelson, Jan 22, 2009.

  1. andyjamesnelson macrumors 6502

    Joined:
    Aug 24, 2003
    Location:
    Jacob's house
    #1
    Hey

    I'm working on a page thats often going to go from having very little content to lots of content in the same window.

    I was wondering if there is a good way to stop the scroll bar jumping the page left a bit?

    Andy
     
  2. JasonElise1983 macrumors 6502a

    JasonElise1983

    Joined:
    Jun 2, 2003
    Location:
    Between a rock and a midget
    #2
    that's a great question. I've always been frustrated with that, but never thought to ask someone. Hmm...

    -je
     
  3. angelwatt Moderator emeritus

    angelwatt

    Joined:
    Aug 16, 2005
    Location:
    USA
    #3
    The most straight forward approach would be to have the scroll bar present always.

    Code:
    overflow-y: scroll;
     
  4. andyjamesnelson thread starter macrumors 6502

    Joined:
    Aug 24, 2003
    Location:
    Jacob's house
  5. andyjamesnelson thread starter macrumors 6502

    Joined:
    Aug 24, 2003
    Location:
    Jacob's house
    #5
    That seems to give one a white bar in which the scroll bar would sit when there isn't enough content on the page.

    I've found that height:101% on html seems to work pretty well.

    Not sure if there are any bad side effects.

    Andy
     
  6. Me1000 macrumors 68000

    Me1000

    Joined:
    Jul 15, 2006
    #6
    having a very small sliver of scroll bar no matter how tall your window is can be very annoying to users...

    I know it annoys me...



    angelwatt's solution is the best...
     
  7. andyjamesnelson thread starter macrumors 6502

    Joined:
    Aug 24, 2003
    Location:
    Jacob's house
    #7
    Sure I get that and I also find it annoying.

    I am just not sure how to use anglewatts suggestion?

    I used it on the html element and it gave an empty white strip which didnt look good either or a least didn't look any better then always having the blue scroll bar/

    Is there no way to achieve the effect without either?

    Andy
     
  8. angelwatt Moderator emeritus

    angelwatt

    Joined:
    Aug 16, 2005
    Location:
    USA
    #8
    Well, you never gave any code, so I can't tell you how to apply it. If you want another solution you can use,

    Code:
    overflow: hidden;
    height: some height;
    But you may not like the result. There'll be no scroll bar, but some content may be inaccessible. You have to realize these scroll bars exist for a reason, and trying to modify how they behave will only result in ruining the user experience.
     
  9. SrWebDeveloper macrumors 68000

    SrWebDeveloper

    Joined:
    Dec 7, 2007
    Location:
    Alexandria, VA, USA
    #9
    Consider a design change -- i.e. displaying a window popup with the updated content, but a REALLY cool one...

    For example use JQuery with the Facebook plugin and add either a link or an onLoad event to trigger a cool looking 3D/shadowed popup window which contains the new content in the form of an .html file. You can then add in the CSS there to display the scroll bars when necessary - the plugin automatically sizes the window for you. This is actually quite nice looking compared to the browser window scroll bars. The window includes "Close" icon, too. Just a suggestion as to an alternative approach.

    -jim
     

Share This Page