0
I want to create a button to cancel a fullscreen event/function without toogle function just click the button and close full screen mode.
someone can help me ?
0
I want to create a button to cancel a fullscreen event/function without toogle function just click the button and close full screen mode.
someone can help me ?
0
I managed to solve my problem with the Javascript
Solution:
<script src="https://code.jquery.com/jquery-3.2.1.min.js"></script>
<script>
function exitFullscreen() {
if(document.exitFullscreen) {
document.exitFullscreen(); }
else if(document.mozCancelFullScreen) {
document.mozCancelFullScreen();}
else if(document.webkitExitFullscreen) {
document.webkitExitFullscreen();
}
}
</script>
html:
<button class="fechar" onclick="exitFullscreen();"> X </button>
Browser other questions tagged javascript
You are not signed in. Login or sign up in order to post.
Just pointing out that the use of
jQueryis optional.– Valdeir Psr
Thanks, @Valdeir Psr , I’m new I was trying to make the codes visible. As an added demo ?
– Luis Rodrigues
Just select all the code and press
Ctrl + K– Valdeir Psr
didn’t work, I did as you said
– Luis Rodrigues
You must select only the code. Or you can insert 4 spaces in each row; or you can still click the icon
{}– Valdeir Psr