Designing Fixed Position Sidebars

Discussion in 'Javascript' started by Roger, May 17, 2007.

  1. Roger

    Roger Guest

    While there are several web sites that make use of sidebars, there are
    relatively few that make use of fixed position sidebars. While fixed
    position sidebars offer the advantage of having the page controls and
    hyperlinks always visible when the user scrolls down a page, they have
    one great disadvantage: a portion of the fixed position sidebar may not
    be visible for some users because of a combination of small vertical
    height and the current browser font size.

    I can think of two possible strategies to address the problems of fixed
    position sidebars. The first is detecting the problem and displaying an
    indication that there is more sidebar to be seen -- for example, display
    a "More" box with a down arrow on the bottom of the sidebar when the
    situation occurs.

    The second strategy is giving the user some dynamic control over what is
    displayed in the sidebar (Note most browsers give the users some
    controls to view a bit more of a hidden sidebar through tempory use of
    full screen mode (F11) or temporary reduction of font size (CTRL-)).
    For example, if there are several logical sections in the sidebar, there
    could be -/+ control buttons that will collapse/expand the contents of
    the section thereby moving the hidden portion higher.

    If there are no logical sections, another possibility is to make the
    "More" box into a control that would move the the side bar higher by
    making the position fixed "top" value a negative px value. A "More"
    control could then be positioned at the top of the sidebar.

    Finally, my questions: By running a script using <body onload =...>, is
    there a way to detect that the bottom of a fixed position sidebar is not
    visible or calculate/estimate the number of pixels needed to show the
    hidden portion?

    Are there other alternatives for dealing with the problems of fixed
    position sidebars (I do not want to use frames.)?

    Roger
     
    Roger, May 17, 2007
    #1
    1. Advertising

  2. Roger wrote:
    > Finally, my questions: By running a script using <body onload =...>, is
    > there a way to detect that the bottom of a fixed position sidebar is not
    > visible or calculate/estimate the number of pixels needed to show the
    > hidden portion?


    if(document.body.offsetHeight<sidebar.offsetHeight)
    alert(sidebar.offsetHeight-document.body.offsetHeight)


    > Are there other alternatives for dealing with the problems of fixed
    > position sidebars (I do not want to use frames.)?


    Use fixed height (e.g. 100%) and set overflow to auto so users can see
    the scrollbar if sidebar's height is bigger than the height of body..
     
    scripts.contact, May 17, 2007
    #2
    1. Advertising

Want to reply to this thread or ask your own question?

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. Leif K-Brooks

    Position:fixed and IE/Win

    Leif K-Brooks, Jul 9, 2003, in forum: HTML
    Replies:
    2
    Views:
    456
    Leif K-Brooks
    Jul 9, 2003
  2. david graham

    position: fixed in IE - how?

    david graham, Sep 12, 2003, in forum: HTML
    Replies:
    2
    Views:
    557
    david graham
    Sep 12, 2003
  3. Replies:
    5
    Views:
    24,813
  4. johnp
    Replies:
    4
    Views:
    3,695
    Toby Inkster
    May 23, 2005
  5. red_dragon2983
    Replies:
    25
    Views:
    700
    Nick Theodorakis
    Mar 25, 2006
Loading...

Share This Page