jQuery automatically hides the method of the specified element over a period of time

  • 2020-05-17 04:43:44
  • OfStack

This example shows how jQuery can automatically hide a specified element over a period of time. Share with you for your reference. The details are as follows:

The following code provides two methods for timing hidden elements, the first using the setTimeout implementation, the second using the delay method provided in jQuery1.4 and later, and the second is simpler.


// This is a 1.3.2 We use setTimeout The way to do it  
////www.ofstack.com
setTimeout(function() { 
$('.showdiv').hide('blind', {}, 500) 
}, 5000); 
 
 
// This is the 1.4 Can be used in delay() this 1 The way the function is implemented 
// (this is very much like dormancy)  
$(".showdiv").delay(5000).hide('blind', {}, 500);

I hope this article has been helpful to your jQuery programming.


Related articles: