pages/js/index.js

35 lines
1 KiB
JavaScript
Raw Normal View History

// Set up fullscreen buttons (used on pages with embedded games)
function fullscreen() {
// check if fullscreen mode is available
if (document.fullscreenEnabled ||
document.webkitFullscreenEnabled ||
document.mozFullScreenEnabled ||
document.msFullscreenEnabled) {
// which element will be fullscreen
var iframe = document.getElementById('embed');
// Do fullscreen
if (iframe.requestFullscreen) {
iframe.requestFullscreen();
} else if (iframe.webkitRequestFullscreen) {
iframe.webkitRequestFullscreen();
} else if (iframe.mozRequestFullScreen) {
iframe.mozRequestFullScreen();
} else if (iframe.msRequestFullscreen) {
iframe.msRequestFullscreen();
}
2017-10-25 22:46:05 +00:00
iframe.contentWindow.focus();
}
else {
console.log('Your browser is not supported');
}
}
let btn = document.getElementById('fullscreenBtn')
if (btn) btn.addEventListener('click', fullscreen)
// Setup Carousel (used on homepage)
$(document).ready(function(){
$('.carousel.carousel-slider').carousel({full_width: true});
});