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


Groups > comp.lang.javascript > #25186

Re: Change UI layout

From danca <cyberdanny@tiscalinet.it>
Newsgroups comp.lang.javascript
Subject Re: Change UI layout
Date 2014-07-02 10:05 +0200
Organization A noiseless patient Spider
Message-ID <lp0egh$jhi$1@dont-email.me> (permalink)
References <d4adnY1xv_wzBi7OnZ2dnUVZ_sqdnZ2d@westnet.com.au> <RD-PE-20140702080218@ram.dialup.fu-berlin.de>

Show all headers | View raw


Il 02/07/2014 08:04, Stefan Ram ha scritto:
> Andrew Poulos <ap_prog@hotmail.com> writes:
>> Is this appropriate?
>
>    The usual approach today is called »Responsive Design«.
>
>    It usually is done with CSS. You use CSS to adapt the
>    page to the screen, like:
>
> @media screen and (max-width:750px) and (min-width:500px)
> { a { width: 50%; }}
> @media screen and (min-width:750px)
> { a { width: 25%; white-space: nowrap; }}
>
>    . Only when CSS alone is not sufficient, one uses JavaScript
>    (»Progressive Enhancement«), along the lines of:
>
> if( window.matchMedia( 'only screen and (max-device-width: 450px)' ).matches )
> ...
> else if
> ( window.matchMedia( 'only screen and (min-device-width: 481px) and (max-device-width: 1024px) and (orientation: portrait)' ).matches )...
>
>    .
>
I tried a similar approach but it does not seems to be a satisfying 
solution to me.
My Android smartphone declares an horizontal resolution of 940 pixels, 
but obviously a standard page is unreadable on the tiny screen, so I 
actually detect the user agent and automatically redirect the mobile 
devices to a dedicated page, instead of rely on the screen resolution.
An explicit button seems to be the rational choice, however. The iPad is 
identified as a mobile device but the screen is wide enough to display 
standard pages.
Dan

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


Thread

Change UI layout Andrew Poulos <ap_prog@hotmail.com> - 2014-07-02 15:39 +1000
  Re: Change UI layout danca <cyberdanny@tiscalinet.it> - 2014-07-02 10:05 +0200
    Re: Change UI layout Andrew Poulos <ap_prog@hotmail.com> - 2014-07-02 23:27 +1000
      Re: Change UI layout Thomas 'PointedEars' Lahn <PointedEars@web.de> - 2014-07-02 15:58 +0200
        Re: Change UI layout Andrew Poulos <ap_prog@hotmail.com> - 2014-07-03 11:36 +1000
          Re: Change UI layout Andrew Poulos <ap_prog@hotmail.com> - 2014-07-03 18:20 +1000
            Re: Change UI layout Thomas 'PointedEars' Lahn <PointedEars@web.de> - 2014-07-03 11:42 +0200
          Re: Change UI layout Thomas 'PointedEars' Lahn <PointedEars@web.de> - 2014-07-03 10:38 +0200
    Re: Change UI layout Dr J R Stockton <reply1400@merlyn.demon.co.uk.invalid> - 2014-07-03 21:51 +0100
      Re: Change UI layout danca <cyberdanny@tiscalinet.it> - 2014-07-04 15:09 +0200
      Re: Change UI layout Dr J R Stockton <reply1400@merlyn.demon.co.uk.invalid> - 2014-07-05 16:10 +0100
  Re: Change UI layout Joao Rodrigues <groups_jr-1@yahoo.com> - 2014-07-05 12:58 -0300
    Re: Change UI layout Christoph Michael Becker <cmbecker69@arcor.de> - 2014-07-05 19:31 +0200
      Re: Change UI layout Thomas 'PointedEars' Lahn <PointedEars@web.de> - 2014-07-06 23:34 +0200

csiph-web