0
我正在嘗試爲樂高指令創建一個動畫。當我點擊兩個按鈕'next'時,我需要選擇它作爲動畫順序(但我不知道如何將變量作爲選擇器調用)。 '背部。'jQuery。動畫。陣列。變量。選擇。下一個/上一個按鈕
我還需要設置「重置」按鈕才能進入第一頁。
任何幫助將不勝感激。謝謝。
This is the rough image of how it looks.
$(document).ready(function() {
var options = ['legs', 'body1', 'cape1', 'cape2', 'head1', 'helmet1']
var count = 0;
$('.back').click(function() {
if (count > 0) { count--; } ** $('') ** .eq(count).animate({ top: '250px' });
})
$('.next').click(function() {
$('').eq(count).animate({ top: '250px' }, 'slow');
count++;
})
$('.reset').click(function() {
count = 0;
$('').html('');
})
});
你能不能發佈html代碼呢,會有幫助。 –