Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > comp.lang.javascript > #21556

fixed position sidebar and small screen/mobile devices?

From John Stumbles <john.stumbles@ntlworld.com>
Newsgroups comp.infosystems.www.authoring.stylesheets, comp.infosystems.www.authoring.html, comp.lang.javascript
Subject fixed position sidebar and small screen/mobile devices?
Date 2011-02-11 12:44 +0000
Message-ID <8rkp9eFjhU1@mid.individual.net> (permalink)

Cross-posted to 3 groups.

Show all headers | View raw


I've made my first serious foray into css with a web layout that has 
'position: fixed' side and top bars like
http://yaph.org.uk/test/layout-fixed.html
so that the site is always visually identified, and users have ready
access to the menu (in the side or top bar) without having to scroll back
to the top if the content is large.

However on an Android (and possibly other mobile devices, or if one
resizes a conventional desktop-based browser down to a small enough
window) the user can't scroll away from the fixed elements to view the
content. Using absolute positioning on the side and top bars like
http://yaph.org.uk/test/layout-absolute.html makes it usable in small
browser windows, and I can easily enough test which browser the user is on
and switch between the two like
http://yaph.org.uk/test/layout-test.php

Here's a 'real' site I'm working on:
http://reading-skeptics.org.uk/home/

I don't want to make the side and top bars percentages of the screen
dimensions as the menu text would wrap and look a right dog's dinner.

Hard-coding HTTP user agents into my PHP script is going to be fun to
maintain ;-( Could I finding out the screen dimensions and switch from
fixed to absolute positioning below a certain threshold? Maybe in
javascript? But I'm even more of a tyro at js: I can just about say
document.write! (I know many users browse with js switched off e.g. using
NoScript (I do so myself) but if the site rendered OK without js and was
just better with it that would be OK.

Help? Suggestions?

-- 
John Stumbles

I am neither for nor against apathy

Back to comp.lang.javascript | Previous | Next — Next in thread | Find similar | Unroll thread


Thread

fixed position sidebar and small screen/mobile devices? John Stumbles <john.stumbles@ntlworld.com> - 2011-02-11 12:44 +0000
  Re: fixed position sidebar and small screen/mobile devices? dorayme <dorayme@optusnet.com.au> - 2011-02-12 03:58 +1100

csiph-web