I have a div, which is generally used for showing some status messsage like "you have selected some xyz thing"
Now, I need to hide it at interval of specific amount of time (say开发者_如何学运维, 60 secs) after page loads.
Code:
<div id="msg">You have selected 'Time and Money' magazine</div>
How can I perform the above mentioned thing?
Thanks
$(document).ready(function () {
setTimeout(function () {
$('#msg').hide();
}, 60000);
});
To hide msg after 60 seconds, do this
$("#msg").fadeOut(60000);
This should do what you need: jQuery Timers
$(function(){
$(document).oneTime(60000, function(){
$('#msg').hide();
});
});
you can use setTimeout this -
$('document').ready(function(){
window.setTimeout('test()',time in milliseconds);
});
function test(){
$('#divid').hide();
}
You can use jQuery's 1.4 delay function
精彩评论