Demo:-
About:- In Previous Article I Write About How to Highlight Searched Text In Gridview . In this Article using JavaScript Learn How to create time wait Counter for downloading anything.
Coding:-
<html>
<head>
<title>Counter Example</title>
<script type="text/javascript" language="javascript">
function startcounter(s)
{
var de = document.getElementById("dCounter");
de.innerHTML = 'Please Wait For<br>' + s + '<br>Seconds';
if(s == 0)
{
document.getElementById("dAd").style.display = 'none';
document.getElementById("dDownload").style.display = 'block';
}
else
{
s--;
setTimeout('startcounter(' + s + ')',500);
}
}
function hidedcounter()
{
document.getElementById("dCounter").style.display = 'none';
}
</script>
</head>
<body onload="startcounter(10)">
<center>
<div id="dCounter" style="font:bold 30px verdana;"></div>
<br><br>
<div id="dAd">
<img src="hydrangeas.jpg" width="300" height="300" border="1" alt="Advertisement"/>
<br><br>
Or <br><a href="#" onclick="startcounter(0),hidedcounter()">Click Here</a>
</div>
<div id="dDownload" style="display:none;">
<input type="button" value="Download"/>
</div>
</center>
</body>
</html>
0 comments:
Post a Comment