I have this revolution slider link I am working with:
<a href="#" id="clickme" onclick="document.dispatchEvent(new Event('RS_OPENMODAL_slider-2')); return false">Auto Popup</a>
I need to turn this into an auto popup. I have tried a few methods with javascript to get it to work, but it only seems to work on Safari and no other browser.
I have tried:
<body onload="document.dispatchEvent(new Event('RS_OPENMODAL_slider-2')); return false">
window.onload = (event) => {
document.dispatchEvent(new Event('RS_OPENMODAL_slider-2'));
event.preventDefault();
};
window.onload = () => {
const button = document.getElementById('clickMe');
button.click();
};
I have even tried a method using a delay, but that also did not work:
setTimeout(document.getElementById('clickme').click(),5000);
I am not seeing any errors and I am running out of ideas. Any help on this would be big. I personally hate this auto popup, but my client has insisted on it.
You can see the button does work when you click on it near the bottom of the page:
https://ae32d5d93a.nxcli.net/