<div dir="ltr" style="text-align: left;"><center>
<span id="countdown">You have to wait 30 seconds.</span></center>
<div style="text-align: center;"><b>Generating link...</b>
<a class="button" href="#" id="download_link" rel="noopener" style="display: none;" target="_blank">Next article</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 = 35;
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 = "wait to next article %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>
</div>
No comments:
Post a Comment