I am looking for a countdown timer for my site that restarts for every visitor that counts down from 10 minutes with seconds showing. What I'm looking to do is create a scrolling countdown timer that says something like "Time remaining on sale" or something similar. Please PM if you can help or can point me in the direction of a generator of some sort. Thanks! Will reward!
<HTML> <HEAD> <TITLE> </TITLE> <script type="text/javascript"> // Insert seconds here var iCount = 600; var sTimeleft = ''; var iSeconds = 0; var iMin = 0; var timer; function Update_Timer() { iCount--; if(iCount >= 60) { iMin = Math.floor(iCount/60); iSeconds = iCount-(iMin*60); } sTimeleft = iMin+'m '+iSeconds+'s left on this offer'; document.getElementById('timer').innerHTML = sTimeleft; timer = window.setTimeout("Update_Timer();",1000); } </script> </HEAD> <BODY onload="Update_Timer();"> <span id="timer"></span> </BODY> </HTML> PHP: This should suit your needs..
I am using this right now but is there a way to make this scroll with the page on the right hand corner or something?
I would use Css to do that <HTML> <HEAD> <TITLE> </TITLE> <style type="text/css"> .timer { position:fixed; top:30px; right:5px; } </style> <script type="text/javascript"> // Insert seconds here var iCount = 600; var sTimeleft = ''; var iSeconds = 0; var iMin = 0; var timer; function Update_Timer() { iCount--; if(iCount >= 60) { iMin = Math.floor(iCount/60); iSeconds = iCount-(iMin*60); } sTimeleft = iMin+'m '+iSeconds+'s left on this offer'; document.getElementById('timer').innerHTML = sTimeleft; timer = window.setTimeout("Update_Timer();",1000); } </script> </HEAD> <BODY onload="Update_Timer();"> <span class="timer" id="timer"></span> </BODY> </HTML> PHP: What i added was: .timer { position:fixed; // Lock it in place even if page scrolls top:30px; // Margin from top right:5px; // Margin from right } and: <span class="timer" id="timer"></span> hope this is what you need/want.
Thanks so much for the help! I have another question.. If I wanted a pop up box for my email opt in list form and wanted it to scroll with the page how can I do this?