Hi!
I work on tableau, and I've created several buttons on top of the normal tableau page (unfortunately can't export the code online).
the problem is, when I enter the fullscreen using the button - It works. but when I try to click it again to exit, it doesn't. if I press escape to exit the mode, the button works again and again.
I'm going to write down the relevant code-
#HTML <div class="fullscreenbutton"><span style="cursor:pointer" onclick="toggleFullscreen(document.body)"> <img src="FullScreen.png" style="width:30px;height:30px"> </span></div>
#CSS .fullscreenbutton { position: absolute; top: 13%; right: 0.5%; color: #818181; } #JS function toggleFullscreen(doc){ if (!document.fullscreenElement && !document.webkitFullscreenElement && !document.mozFullscreenElement && !document.msFullscreenElement) { if(doc.requestFullscreen) {doc.requestFullscreen();} else if (doc.webkitRequestFullscreen) {doc.webkitRequestFullscreen();} else if (doc.msRequestFullscreen) {doc.msRequestFullscreen();} else if (doc.mozRequestFullscreen) {doc.mozRequestFullscreen();} } else { if(doc.exitFullscreen) {doc.exitFullscreen();} } else if (doc.webkitExitFullscreen) {doc.webkitExitFullscreen();} else if (doc.msExitFullscreen) {doc.msExitFullscreen();} else if (doc.mozExitFullscreen) {doc. [url=xxxxxxxxx]voojio[/url]msCancelFullscreen();} }
Thank you!
Last edited by SalinaS on Thu Feb 17, 2022 5:06 am, edited 1 time in total.
|