How to make work scripts on iphone “safari”?
Clash Royale CLAN TAG#URR8PPP
How to make work scripts on iphone “safari”?
three days already trying to solve problems with this scripts and right now I see that this scripts don't want to work in phone. These script must close iframe then clicking on modal or icon .close. It perfectly works on PC but not on iphone. Also adding codepen https://codepen.io/jokbas-rklys/pen/zJaxQN Maybe someone know the solution?
// Get the modal
var modal = document.getElementById('popupBoxOnePosition');
var modal2 = document.getElementById('popupBoxTwoPosition');
var modal3 = document.getElementById('popupBoxThreePosition');
var modal4 = document.getElementById('popupBoxFourPosition');
var exit = document.getElementById('close1');
var exit2 = document.getElementById('close2');
var exit3 = document.getElementById('close3');
var exit4 = document.getElementById('close4');
// When the user clicks anywhere outside of the modal, close it
window.onclick = function(event)
if (event.target == modal)
$('.iframe1')[0].contentWindow.postMessage('"event":"command","func":"' + 'stopVideo' + '","args":""', '*');
modal.style.display = "none";
if (event.target == modal2)
$('.iframe2')[0].contentWindow.postMessage('"event":"command","func":"' + 'stopVideo' + '","args":""', '*');
modal2.style.display = "none";
if (event.target == modal3)
$('.iframe3')[0].contentWindow.postMessage('"event":"command","func":"' + 'stopVideo' + '","args":""', '*');
modal3.style.display = "none";
if (event.target == modal4)
$('.iframe4')[0].contentWindow.postMessage('"event":"command","func":"' + 'stopVideo' + '","args":""', '*');
modal4.style.display = "none";
if (event.target == exit)
$('.iframe1')[0].contentWindow.postMessage('"event":"command","func":"' + 'stopVideo' + '","args":""', '*');
modal.style.display = "none";
if (event.target == exit2)
$('.iframe2')[0].contentWindow.postMessage('"event":"command","func":"' + 'stopVideo' + '","args":""', '*');
modal2.style.display = "none";
if (event.target == exit3)
$('.iframe3')[0].contentWindow.postMessage('"event":"command","func":"' + 'stopVideo' + '","args":""', '*');
modal3.style.display = "none";
if (event.target == exit4)
$('.iframe4')[0].contentWindow.postMessage('"event":"command","func":"' + 'stopVideo' + '","args":""', '*');
modal4.style.display = "none";
Can you please share a Minimal, Complete, and Verifiable example of your attempt, noting expected output?
– Islam Elshobokshy
16 mins ago
codepen.io/jokbas-rklys/pen/zJaxQN
– Jokūbas Rėklys
12 mins ago
By clicking "Post Your Answer", you acknowledge that you have read our updated terms of service, privacy policy and cookie policy, and that your continued use of the website is subject to these policies.
The Snippet doesn't work ' "message": "Uncaught SyntaxError: Unexpected token <", "filename": "stacksnippets.net/js", "lineno": 13, "colno": 9 '
– Dominik
20 mins ago