Home  >  Article  >  Web Front-end  >  How to implement timed hiding of dialog boxes in jQuery

How to implement timed hiding of dialog boxes in jQuery

亚连
亚连Original
2018-06-06 10:05:321307browse

This article mainly introduces the method of jQuery to implement timed hiding dialog box. It analyzes the related functions, implementation methods and operation precautions of jQuery timed hiding dialog box in detail in the form of examples. Friends in need can refer to the following

The example in this article describes how jQuery implements timed hiding of dialog boxes. Share it with everyone for your reference, the details are as follows:

The following content may not be completely correct, it is only for reference when you have questions.

1. setTimeout

: There is a situation where the time is set but the program is executed immediately.

: Whether it is window.setTimeout or window.setInterval, parameters cannot be taken when using the function name as the calling handle.

: The solution is to define an anonymous function

setTimeout(function(){$j('#pre'+ID).fadeOut()},12000);

: The second parameter is the number of milliseconds, 1 second = 1000 milliseconds

Other situations: Introduction to this URL: http: //www.jb51.net/article/36681.htm

2. Set the hiding of the dialog box

Common method one:

Commonly used method two: