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
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
Share Improve this question edited Jan 25, 2011 at 0:48 Justin Johnson 31.3k7 gold badges66 silver badges89 bronze badges asked Jan 19, 2011 at 5:23 I-M-JMI-M-JM 16k26 gold badges79 silver badges105 bronze badges5 Answers
Reset to default 6$(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