CodeMonster

1224537_46304928

Getting into Fullscreen

Recently i got an assignment to make a fullscreen case display for a printing company. At first i looked at a flash solution. But since im not too fond of flash and we quite recently got support for javascript fullscreen in some browsers, i decided to make it with javascript instead.

And now for the good parts some code.

//webkit browsers
element.webkitRequestFullScreen();
//firefox
element.EnterFullScreen();

This will work for regular divs and iframes etc.

If you want fullscreen on a html5 video element the code is the same for firefox but differ for webkit browser. To get fullscreen on a video in a webkit browser. Just use video.webkitEnterFullScreen(); instead.

This was just a short start on the subject. To get things started on the blog. I will update it later on. If you want to read more i suggest you read this great article http://www.thecssninja.com/javascript/fullscreen.

6:11 PM Wednesday, December 14, 2011