Donator
- Înscris
- 6 Mar 2012
- Mesaje
- 451
- Subiect Autor
- #1
Salutare.
Acesta este un script de download, dar cu un delay de cateva secunde. Il puteti testa aici: http://htmledit.squarefree.com/
Problema mea este ca la sfarsitul celor 20 de secunde de asteptare, imi ramane cifra 1. Cum as putea sa fac sa se ascunda imediat dupa ce se termina ?
Astept un raspuns daca cineva ma poate ajuta.
Multumesc mult, o zi buna !
Acesta este un script de download, dar cu un delay de cateva secunde. Il puteti testa aici: http://htmledit.squarefree.com/
Problema mea este ca la sfarsitul celor 20 de secunde de asteptare, imi ramane cifra 1. Cum as putea sa fac sa se ascunda imediat dupa ce se termina ?
Cod:
<html><head>
<script type="text/javascript">
var c = 20;
function fcwait() {
if(document.getElementById("divDLWait")==null || document.getElementById("divDLStart")==null){
setTimeout("fcwait()", 1000);
return;
}
if (c > 0) {
var el = document.getElementById("downloadDelayTimeSec");
if( el ){
el.innerHTML = "" + c;
}
c = c - 1;
setTimeout("fcwait()", 1000);
}
else {
document.getElementById("divDLWait").style.display = 'none';
document.getElementById("divDLStart").style.display = 'block';
}
}
fcwait();
</script>
<style>
#divDLStart{
display: none;
}
</style>
</head>
<body>
<div id="divDLWait"> Please wiat until the download link appears</div>
<div id="divDLStart"> <a href="www.google.com">Download Link</a></div>
<div id="downloadDelayTimeSec">20</div>
<div id=""></div>
<div id=""></div>
<div id=""></div>
</body></html>
Astept un raspuns daca cineva ma poate ajuta.
Multumesc mult, o zi buna !