View Single Post
Old 10-11-2012, 01:23 PM   PM User | #5
coothead
Senior Coder

 
coothead's Avatar
 
Join Date: Jan 2004
Location: chertsey, a small town 25 miles south west of london, england.
Posts: 1,551
Thanks: 0
Thanked 195 Times in 191 Posts
coothead will become famous soon enough
Hi there Shaqcoulter,

try it like this...
Code:
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN"
   "http://www.w3.org/TR/html4/strict.dtd">
<html lang="en">
<head>

<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
<meta name="language" content="english"> 
<meta http-equiv="Content-Style-Type" content="text/css">
<meta http-equiv="Content-Script-Type" content="text/javascript">

<title>First Time?</title>
<style type="text/css">
#firstTime {
    width:100px;
    margin:auto;
    cursor:pointer;
    text-align:center;
 }
#firstTime:hover {
    color:#f00;
 }
</style>

<script type="text/javascript">

function toggleFullScreen() {
if((document.fullScreenElement && document.fullScreenElement!== null)||
  (!document.mozFullScreen && !document.webkitIsFullScreen)) {
if(document.documentElement.requestFullScreen) {
   document.documentElement.requestFullScreen();
 } 
else {
if(document.documentElement.mozRequestFullScreen) {
   document.documentElement.mozRequestFullScreen();
 } 
else { 
if(document.documentElement.webkitRequestFullScreen) {
   document.documentElement.webkitRequestFullScreen(Element.ALLOW_KEYBOARD_INPUT);
} 
else {
if(document.cancelFullScreen) {
   document.cancelFullScreen();
} 
else {
if(document.mozCancelFullScreen) {
   document.mozCancelFullScreen();
} 
else {
if(document.webkitCancelFullScreen) {
   document.webkitCancelFullScreen();
        }
       }
      }
     }
    }
   }
  }
 }

function init(){
document.getElementById('firstTime').onclick=function() {
   toggleFullScreen();
  }
 }

   window.addEventListener?
   window.addEventListener('load',init,false):
   window.attachEvent('onload',init);
</script>

</head>
<body>

<div id="firstTime">First Time?</div>

</body>
</html>
coothead
coothead is offline   Reply With Quote