I'm trying to make a element of my website in fullscreen when we click on it, and it works with chrome, IE, but not with firefox.
I went to the microsoft fullscreen API, and I tested theire code, and there is no problems with any of this browsers.
Here the part of my web site I want to put in full screen.
<div class="wrap">
<div class="signin">
<div style="margin: 2px 0px -25px 10px;"><h1>Sign In or <a href="<?php echo $this->url(array('module' => 'default','controller'=>'paid-sign-up','action'=>'index'),null,true); ?>" style="color:#F00;text-decoration:none;">Signup</a></h1></div>
<?php echo $this->signin(); ?>
<span class="forget">
<a href="<?php echo $this->url(array('module' => 'default','controller'=>'forgot-password','action'=>'index'),null,true); ?>">Forgotten Password?</a> </span>
</div>
And here the script I use
<script type="text/javascript">
var inFullScreen = false; // flag to show when full screen
var fsClass = document.getElementsByClassName("wrap");
for (var i = 0; i < fsClass.length; i++) {
fsClass[i].addEventListener("click", function (evt) {
if (inFullScreen == false) {
makeFullScreen(evt.target); // open to full screen
} else {
reset();
}
}, false);
}
function makeFullScreen(divObj) {
alert (divObj);
if (divObj.requestFullscreen) {
alert ('standard');
divObj.requestFullscreen();
}
else if (divObj.msRequestFullscreen) {
alert ('ms');
divObj.msRequestFullscreen();
}
else if (divObj.mozRequestFullScreen) {
alert ('moz');
divObj.mozRequestFullScreen();
}
else if (divObj.webkitRequestFullscreen) {
alert ('webkit');
divObj.webkitRequestFullscreen();
}
inFullScreen = true;
return;
}
function reset() {
if (document.exitFullscreen) {
document.exitFullscreen();
}
else if (document.msExitFullscreen) {
document.msExitFullscreen();
}
else if (document.mozCancelFullScreen) {
document.mozCancelFullScreen();
}
else if (document.webkitCancelFullScreen) {
document.webkitCancelFullScreen();
}
inFullScreen = false;
return;
}
</script>
And the last info who can be usefull, my website is a zent framework website, it's why there is some PHP.