Are you first timer at lazacode.org? Why not join us and start exchange your programming knowledge with everyone. Register today!

jQuery setTimeout function

0 votes
100 views
added Sep 26, 2018 in jQuery by LC Marshal Captain (25,700 points)
$(function() {
    // setTimeout() function will be fired after page is loaded
    // it will wait for 5 sec. and then will fire
    // $("#successMessage").hide() function
    setTimeout(function() {
        $("#successMessage").hide('blind', {}, 500)
    }, 5000);
});

 

3 Responses

0 votes
responded Sep 26, 2018 by LC Marshal Captain (25,700 points)
setTimeout(function() {
  $('#successMessage').fadeOut('fast');
}, 30000); // <-- time in milliseconds

 

0 votes
responded Oct 31, 2018 by LC Marshal Captain (25,700 points)
setTimeout(function(){
    var img = new Image(1,1);
    img.src = '/logo?ver=1&sid=fbca20f2aefe71348395e4e9d83f9393&t='+1540969935+1;
},0);

 

0 votes
responded Feb 26 by lcjr Sergeant (2,320 points)
var compactOverlayUnit = $('.ads-compact-overlay'),
    unitTimeOut = 7400;

setTimeout(function() { 
    if (compactOverlayUnit.hasClass('in')) {
        compactOverlayUnit.removeClass('in'); 
        // compactOverlayUnit.hide();
    } 
}, unitTimeOut);

 

lazacode.org - Malaysia's programming knowledge sharing platform, where everyone can share their finding as reference to others.
...