我對jQuery有點新,我在這個實例中設置隊列時遇到了麻煩。jquery無限隊列
我想這樣做:在鼠標懸停時,第一個隊列條目被觸發。然後它等待,直到另一個鼠標懸停來觸發下一個隊列條目。無限循環隊列。
$("#header").mouseover(function() {
var $shineCopy = $("#shine111").clone();
$shineCopy.appendTo('body').animate({
width: "300px",
height: "300px",
opacity: 0,
"left": 0,
"top": 100
}, 1000, function() {
$(this).remove();
});
$shineCopy.appendTo('body').rotate({animateTo:180})
});
$("#header").mouseover(function() {
var $shineCopy = $("#shine222").clone();
$shineCopy.appendTo('body').animate({
width: "300px",
height: "300px",
opacity: 0,
"left": 0,
"top": 200
}, 1000, function() {
$(this).remove();
});
$shineCopy.appendTo('body').rotate({animateTo:180})
});
$("#header").mouseover(function() {
var $shineCopy = $("#shine222").clone();
$shineCopy.appendTo('body').animate({
width: "300px",
height: "300px",
opacity: 0,
"left": 0,
"top": 300
}, 1000, function() {
$(this).remove();
});
$shineCopy.appendTo('body').rotate({animateTo:180})
});
你能說清楚你需要什麼幫助嗎? – iambriansreed
你只是綁定了三個事件處理程序,它們都將被同時執行......如果你想改變連續事件的行爲,你可能想看看我寫的這個插件:https:// github .com/fkling/jQuery-Function-Toggle-Plugin –
費利克斯,這是如此的優雅和美麗。謝謝! – nuclearsugar