FreeHostia Forums
https://forum.freehostia.com/

Full screen button works only when going in, not out
https://forum.freehostia.com/viewtopic.php?f=8&t=66196
Page 1 of 1

Author:  SalinaS [ Thu Jan 27, 2022 1:01 pm ]
Post subject:  Full screen button works only when going in, not out

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!

Author:  bbanev [ Tue Feb 01, 2022 5:42 am ]
Post subject:  Re: Full screen button works only when going in, not out

Hello,

Please have in mind that the forum is designed for out hosting services and we cannot really assist you with custom website development

Best Regards,
Bobby Banev
Moderators team

Page 1 of 1 All times are UTC
Powered by phpBB © 2000, 2002, 2005, 2007 phpBB Group
http://www.phpbb.com/