$(function(){
var $inputs = $( 'input[type=button]')
.delay(500)
.queue(function(){$(this).hide().dequeue();})
.delay(1500)
.queue(function(){$(this).show();});
});
The above code makes the button in the page 500 milliseconds after the page is loaded. Hide, then show after 1500 milliseconds.
$(function(){
var $inputs = $('input[type=button]')
.delay(500)
.queue(function(){$(this).hide().dequeue();})
.delay (1500)
.show(1);
//.queue(function(){$(this).show();});
});
The above code has the same effect as the previous code.
$(function(){
var $inputs = $('input[type=button]')
.delay(500)
.queue(function(){$(this).hide();})
.delay(1500)
.show(1);
//.queue(function(){$(this).show();});
});
Same code as above It is only hidden and will not be displayed again. Compared with code 2, the code in queue does not call dequeue. It can be seen that after the execution of queue is completed, the continued execution of the animation queue is also stopped, and dequeue needs to be called to continue execution (here in queue hide() is not an animation, and there will be problems if the animation of the current object is executed in the queue).
$(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 displayed again! ! Here show no longer specifies the duration of the animation, so the show method is no longer an animation. It can be seen that dequeue can only make subsequent methods in the animation queue execute, but cannot make jquery methods in non-animation queues continue to execute!
Statement:The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn