'How use RequestFullScreen for safari?
i'm trying to use RequestFullScreen in my webApp, this work fine with my android phone, but i can't do it for safari on Iphone...
And i have an other question pls. I want disable longtouch vibration on any phone, this doesn't work when i use this e.stopPropagation!
thanks you!
i use webkitRequestFullScreen for it like this :
const full = document.querySelector('.fullscreen')
full.addEventListener("click", function(){
if (full.textContent==="Plein Ecran"){
full.textContent= "Quitter Plein Ecran"
if(mydocument.requestFullscreen){
mydocument.requestFullscreen();
}
else if (mydocument.msRequestFullScreen){`
mydocument.msRequestFullScreen();`
}
else if (mydocument.mozRequestFullScreen){`
mydocument.mozRequestFullScreen();`
}
else if(mydocument.webkitRequestFullScreen){`
mydocument.webkitRequestFullScreen();`
}`
}
else
{
if(document.exitFullscreen){
document.exitFullscreen();
}
else if (document.msexitFullscreen){
document.msexitFullscreen();
}
else if (document.mozexitFullscreen){
document.exitFullscreen();
}
else if (document.webkitexitFullscreen){
document.webkitexitFullscreen();
}
full.textContent="Plein Ecran"
}
})`
and i tried this for the vibration.
`document.getElementById('body').addEventListener("touchstart", (e)=>{ e.stopPropagation(); }, { passive: true });`
Sources
This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.
Source: Stack Overflow
| Solution | Source |
|---|
