You don't need JavaScript to detect orientation on the iPhone or any
other smart phone that supports CSS3 media queries (Anroid, Fennec,
Opera Mobile).

/* Portrait*/
@media screen and (max-width: 320px) and (orientation:portrait)
{
    // Portrait Styles
}

/* Landscape */
@media screen and (min-width: 321px) and (orientation:landscape)
{
    // Landscape Styles
}

Full article here - http://www.thecssninja.com/css/iphone-orientation-css

On Feb 20, 11:44 pm, deset45 <[email protected]> wrote:
> Hello
>
> Im new to developing sites for the iphone.
>
> What i need is a way to change the layout or unhide if possible
> certain objects when the user changes from portrait to landscape etc
>
> For example, in portrait, it would be  like this in portrait mode (I
> hope the layout is the same when it gets posted lol):
> ----------------------------------------------------------
>     Main title .png
> ----------------------------------------------------------
>
> whatever                                       >
> whatever2                                     >
> whatever3                                     >
>
> ----------------------------------------------------------
>
> but then when the user rotates to landscape:
> main banner is replaced, and a button is unhidden.
> ----------------------------------------------------------------------------------------------
>   Larger alternatiive Main title .png       (Button/anythingelse.png )
> ----------------------------------------------------------------------------------------------
> whatever
>
> whatever2
>
> whatever3
>
> ----------------------------------------------------------------------------------------------
>
> Is it possiible to do this, or would it be much easier to just have
> some sort of code that detects if the user is in portrait mode and
> notifys them to rotate to landscape OR just force the viewing to come
> out landscape somehow.
>
> Can anyone help, and possible expand on their answer as Im more into
> the graphic side of websites rather than coding
>
> Thanks
>
> James

-- 
You received this message because you are subscribed to the Google Groups 
"iPhoneWebDev" group.
To post to this group, send email to [email protected].
To unsubscribe from this group, send email to 
[email protected].
For more options, visit this group at 
http://groups.google.com/group/iphonewebdev?hl=en.

Reply via email to