How to add countdown timer for starting download for blogger and wordpress Posted by Tanush Gupta Add Comments Saturday, January 8, 2022 How to add countdown timer for starting download for blogger and wordpress Hello Guys, Today i am going to tell that how can you add a countdown to start download Source Code <div dir="ltr" style="text-align: left;" trbidi="on"> <body> <center> <span id="countdown">You have to wait 15 seconds.</span></center> <br /> <div style="text-align: center;"> <b>Download Timer</b><br /> <a href="#" id="download_link" style="display: none;"><img src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjhLFOGaQNIp8b1skcFWDfmAS8Ra0-K5PbPHAqIhrPg12ONaGl5n7pn_7wJjqPiDBe2sn8_6lS3ypfvp1gEP3sAnYrBh1drkLSp2xl3Lm9zBoQ5AhNkdOnwx7Srhkbma5EzW6u97oDBsnU/s1600/but.jpg" /></a> <noscript>JavaScript needs to be enabled in order to be able to download.</noscript> <script type="application/javascript"> (function(){ var message = "%d seconds before download link appears"; // seconds before download link becomes visible var count = 15; var countdown_element = document.getElementById("countdown"); var download_link = document.getElementById("download_link"); var timer = setInterval(function(){ // if countdown equals 0, the next condition will evaluate to false and the else-construct will be executed if (count) { // display text countdown_element.innerHTML = "You have to wait %d seconds.".replace("%d", count); // decrease counter count--; } else { // stop timer clearInterval(timer); // hide countdown countdown_element.style.display = "none"; // show download link download_link.style.display = ""; } }, 1000); })(); </script> </div> </body></div> Copy Codes Please leave a comment
comment 0 Post a Comment
more_vert