Http://www.cnblogs.com/zhwl/p/4328279.html
$(
‘#object‘
).hide(
‘slow‘
).queue(
function
(next){
$(
this
).appendTo($(
‘#goal‘
));
next();
}).show(
‘slow‘
);
$(
‘div‘
).slideUp(
‘slow‘
).slideDown(
‘slow‘
,
function
(){
$(
‘#object‘
).css({
"background"
:
"red"
});
});
$(
"#object"
)
.delay(1000,
"fader"
)
.queue(
"fader"
,
function
(next) {
$(
this
).animate({opacity: 0},
{duration: 1000, queue:
false
});
next();
})
.dequeue(
"fader"
)
.animate({top:
"-=40"
}, {duration: 2000})
|
Let's take a look at the idea: to store control opacity and motion-controlled animations in two queues, control the upward-moving queue by default (within 2000 milliseconds), and control the opacity within 1000 milliseconds, but this queue will be executed after the default queue of 1000 milliseconds.
The simple point is: the first 1000 milliseconds, only the control height of the "FX" queue execution, and then 1000 milliseconds, control the opacity of the "fader" queue and control the height of "FX" parallel
Advanced usage of jquery animations--detailed in the. Queue () function in animation