-1

I have written a javascript on page load that

if(!window.fullScreen) window.open(document.URL,'','fullScreen=yes,toolbar=no,location=no,directories=no,status=no,menubar=no,scrollbars=no,resizable=no');}

but window.fullScreen always come false so it keep opening window.

any other way to check if window is in full screen mode or not?

Thanks

BreakHead
  • 10,480
  • 36
  • 112
  • 165
  • I think the problem is that you open the new window but don't set the original fullscreen flag, so if the first page is in fullscreen you never open anything, whan not you're opening more and more pages. Not a JS developer, but you can try to add window.fullscreen = true after opening the new window... – Vincenzo Maggio Jul 03 '12 at 09:14
  • this question has been discussed in this forum: http://stackoverflow.com/questions/2863351/checking-if-browser-is-in-fullscreen http://stackoverflow.com/questions/1047319/detecting-if-a-browser-is-in-full-screen-mode – Falaque Jul 03 '12 at 09:17
  • just wondering, why you want to achieve this? Opening a new window just because its not in full screen mode doesn't seem to be a good ux practice. – Falaque Jul 03 '12 at 09:27
  • @vincenzo windows.fullscreen will always return false inspite of setting it to true – BreakHead Jul 03 '12 at 10:42
  • @Falaque please read the question before commenting :D – BreakHead Jul 03 '12 at 10:43

1 Answers1

0

You forgot the opening bracket

    if(!window.fullScreen){//<- Forgot opening bracket
    window.open(document.URL,'','fullScreen=yes,toolbar=no,location=no,directories=no,status=no,menubar=no,scrollbars=no,resizable=no');
    }
Ashwin Singh
  • 7,197
  • 4
  • 36
  • 55