Processing
 

How to toggle Chrome to full screen automatically

25/02/2014 08:16#1

Edgar

Member

Joined at: 11 months ago

Post: 18

Thank: 0

Thanked: 0

I'm trying to toggle chrome to full screen automatically, but it does not work, here is the sample code

<html> <script src="jquery-1.9.1.min.js"></script> <div>Full Screen Test</div> <input id="fullScreentButton" type="button" value="toggle" onclick="enterFullScreen()"> <script type="text/javascript">     //enter the fullscreen on click, works.     function enterFullScreen(){         var element = document.getElementsByTagName('body')[0];         element.webkitRequestFullscreen(Element.ALLOW_KEYBOARD_INPUT);     }     function enterFullScreenInJquery(){         $('#fullScreentButton').trigger('click');     }     //enter the fullscreen on startup, does not work     enterFullScreenInJquery(); </script> 

If I click the button, it works, how come the jquery one does not work?

25/02/2014 08:21Top#2

Joined at: 8 months ago

Post: 3

Thank: 0

Thanked: 0

The fullscreen JavaScript API only works during user interaction, so it cannot be used maliciously.

Similar articles

Chrome, THREE.js: Cross-origin image load denied

5 years ago - Reply: 5 - Views: 269

Prevent Google Chrome Log XMLHttpRequest

3 years ago - Reply: 5 - Views: 276

How can I include ChromeDriver in a JAR?

3 years ago - Reply: 3 - Views: 81

Chrome geolocation not working on any site

3 years ago - Reply: 1 - Views: 46

wrong borders' width in android browser

3 years ago - Reply: 4 - Views: 206

Uncaught SyntaxError: Unexpected token < On Chrome

3 years ago - Reply: 10 - Views: 468

Flashdata not getting cleared in Codeigniter

3 years ago - Reply: 5 - Views: 57

Illegal access Javascript error in Chrome

3 years ago - Reply: 1 - Views: 51

ng-repeat not updating in Chrome

3 years ago - Reply: 1 - Views: 81

Applying border to a checkbox in Chrome

4 years ago - Reply: 2 - Views: 118

open browser plugin using access vba

3 years ago - Reply: 1 - Views: 25

vé máy bay vé máy bay giá rẻ ve may bay ve may bay gia re vé máy bay vé máy bay giá rẻ ve may bay ve may bay gia re vé máy bay vé máy bay giá rẻ ve may bay ve may bay gia re vé máy bay vé máy bay giá rẻ ve may bay ve may bay gia re vé máy bay vé máy bay giá rẻ ve may bay ve may bay gia re vé máy bay vé máy bay giá rẻ ve may bay ve may bay gia re vé máy bay vé máy bay giá rẻ ve may bay ve may bay gia re