I have been reading over various discussions within the forum on how to install a button that will allow the browser to go full screen if the user likes.
It seems rather simple and easy to implement, unfortunately I am having a great deal of confusion as to how I should get this into my page.
The example link I list below has almost exactly what I am looking for aside from the look of the actual buttons. Essentially, a button that initiates fullscreen in the browser is what I desire. Any suggestions on how to do this effectively?
I am reaching out for help as a first time poster, and again please forgive my inability to figure this out on my own. I have little knowledge on how to implement Javascripts directly into my pages, but I am familiar and confident with pre-made actions and little HTML scripts.
OK - here it is. The code block below should be saved as a .js file and referenced in your FW page in Page>Html Markup in the Before section using the following line
Save the code below in a plain text editor as whatever-fullscreen.js and FTP it to your site.
(function () {
var viewFullScreen = document.getElementById("view-fullscreen");
if (viewFullScreen) {
viewFullScreen.addEventListener("click", function () {
var docElm = document.documentElement;
if (docElm.requestFullscreen) {
docElm.requestFullscreen();
}
else if (docElm.mozRequestFullScreen) {
docElm.mozRequestFullScreen();
}
else if (docElm.webkitRequestFullScreen) {
docElm.webkitRequestFullScreen();
}
}, false);
}
var cancelFullScreen = document.getElementById("cancel-fullscreen");
if (cancelFullScreen) {
cancelFullScreen.addEventListener("click", function () {
if (document.exitFullscreen) {
document.exitFullscreen();
}
else if (document.mozCancelFullScreen) {
document.mozCancelFullScreen();
}
else if (document.webkitCancelFullScreen) {
document.webkitCancelFullScreen();
}
}, false);
}
})();
Now on your FW page create a couple of graphics - one for activating FullScreen and one for cancelling. Give them the Name/IDs of ‘view-fullscreen’ and ‘cancel-fullscreen’ - you can add rollover effects etc. to them.