I have a script which displays seconds before showing hiding the div.
var seconds_left = 20;
var interval = setInterval(function() {
document.getElementById('timer_div').innerHTML = "Or wait " + --seconds_left + " seconds to play the video.";
if (seconds_left <= 0)
{
//alert('The video is ready to play.');
$('#def').fadeOut('slow');
clearInterval(interval);
}
}, 1000);
The problem is.. even the page is not fully loaded, the counting automatically starts.
What can i do to make the counting start after the page fully loaded?