Copy Code code as follows:
$ (function () {
var $inputs = $ (' Input[type=button] ')
. Delay (500)
. Queue (function () {$ (this). Hide (). Dequeue ();})
. Delay (1500)
. Queue (function () {$ (this). Show ();});
});
The above code lets the button in the page Hide 500 milliseconds after the page is loaded, and then displays it in 1500 milliseconds.
Copy Code code as follows:
$ (function () {
var $inputs = $ (' Input[type=button] ')
. Delay (500)
. Queue (function () {$ (this). Hide (). Dequeue ();})
. Delay (1500)
. Show (1);
. Queue (function () {$ (this). Show ();});
});
The above code effect is the same as the preceding code.
Copy Code code as follows:
$ (function () {
var $inputs = $ (' Input[type=button] ')
. Delay (500)
. Queue (function () {$ (this). Hide ();})
. Delay (1500)
. Show (1);
. Queue (function () {$ (this). Show ();});
});
The above code is also only hidden, will not be shown, compared to code 2,queue in the code does not tune Dequeue, so, after the queue execution, also suspended the animation queue to continue execution, need to invoke the dequeue to carry it down (here queue in the Hide () is not an animation , and there is a problem with animating the current object in the queue.
Copy Code code as follows:
$ (function () {
var $inputs = $ (' Input[type=button] ')
. Delay (500)
. Queue (function () {$ (this). Hide (). Dequeue ();})
. Delay (1500)
. Show ();
. Show (1);
});
The above code is only hidden, and will not be shown again!! Here show no longer specifies the length of the display animation, the shows method is no longer an animation. As a result, dequeue can only allow subsequent methods in the animation queue to continue without the jquery method in the non-animated queue!