Gutspiller Posted February 20, 2009 Share Posted February 20, 2009 I have googled and found most of the work, but I know nothing about javascript. This timer counts down and displays the timer, then the timer disappears and displays a text link. For the life of me I can't figure out how to get it to have text before the timer though, but still disappear when the timer does. So it would say something like "Your download will be ready in 15 seconds." And the 15 counts down, but the rest of the words stay the same. Then just like the code already does, it disappears and displays the download link. I've pasted the code below. Can somebody please help me with what I need to add and where? Thanks for any help! <!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01//EN" "http://www.w3.org/TR/html4/strict.dtd"> <html> <head> <title>Count Down Link - Demo</title> <meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1"> <style type="text/css"> .cent { text-align:center; margin:0 auto; } </style> <script type="text/javascript"> document.write('<style type="text/css">#timed{display:none;}<\/style>') function delay_link(){ var d=delay_link, t=document.getElementById('timed'); if(d.c&&d.c.nodeValue.replace(/[^\d]*/,'')-1>0){ d.c.nodeValue='\xa0\xa0'+(d.c.nodeValue.replace(/[^\d]*/,'')-1); setTimeout('delay_link()', 1000) return; } else if(!d.c){ d.c=document.createTextNode('10'); t.parentNode.insertBefore(d.c,t); setTimeout('delay_link()', 1000) return; } d.c.nodeValue=''; t.style.display='inline'; } </script> </head> <body> <div class="cent"><a id="timed" href='http://www.download.com/dsplus/ds.php?p=<filename />&t=<token />'>Click Here to start your download</a></div> <script type="text/javascript">delay_link();</script> </body> </html> Quote Link to comment Share on other sites More sharing options...
Gutspiller Posted March 4, 2009 Author Share Posted March 4, 2009 Can anybody still help me? Quote Link to comment 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.