2011/5/19 Matthias Reuter <[email protected]>:
>> I imagine a use case where a webapp hides some if its UI elements when a
>> user goes fullscreen, giving him more of actual content area. Not
>> necessarily an always desired behaviour but interesting.
>
> I think it's easier to detect fullscreen mode than a maximized window. A
> script might detect fullscreen by comparing screen.width and
> document.documentElement.clientWidth (resp. height):
>
> function isFullScreen () {
>    var docEl = document.documentElement;
>
>    return screen.width === docEl.clientWidth && screen.height ===
> docEl.clientHeight;
> }
>
> Matt
>

This can have issues in case of multiple screens. Opera and Internet
Explorer always returns the width/height of the primary screen, while
Firefox and Chrome returns it for the screen the window is currently
on (or at least what the OS suggests it is on atm).

-- 
Poetro

-- 
To view archived discussions from the original JSMentors Mailman list: 
http://www.mail-archive.com/[email protected]/

To search via a non-Google archive, visit here: 
http://www.mail-archive.com/[email protected]/

To unsubscribe from this group, send email to
[email protected]

Reply via email to