lovephp Posted April 3, 2014 Share Posted April 3, 2014 (edited) guys i got this code which works ok for redicreting to a url in 4seconds when the page loads or refreshes but how could i make a pause and play for this and store it in session so that it do not redirect? <script type = "text/javascript"> window.setTimeout("autoClick()", 4000); // 4 seconds delay function autoClick() { var linkPage = document.getElementById('dialit').href; window.location.href = linkPage; } </script> thanks Edited April 3, 2014 by lovephp Quote Link to comment https://forums.phpfreaks.com/topic/287488-how-do-i-make-a-pause-and-play-even-on-page-refresh/ Share on other sites More sharing options...
cyberRobot Posted April 4, 2014 Share Posted April 4, 2014 Have you tried using clearTimeout()? There's an example of what it sounds like you want to do here: https://developer.mozilla.org/en-US/docs/Web/API/window.setTimeout Quote Link to comment https://forums.phpfreaks.com/topic/287488-how-do-i-make-a-pause-and-play-even-on-page-refresh/#findComment-1474939 Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.