0
我最近做了這個教程:http://fearlessflyer.com/2010/08/how-to-create-your-own-jquery-content-slider/我想知道是否有人知道如何使用本教程中的代碼,但將其更改爲在點擊文本時自動滾動瀏覽圖像而不是滾動瀏覽。如何自動執行此幻燈片的代碼?
在檢查後鼠標滾動圖片代碼「點擊」事件是:
$(theImage).each(
function(intIndex){
$(this).nextAll('a')
.bind("click", function(){
if($(this).is(".next")) {
$(this).parent('li').parent('ul').animate({
"margin-left": (-(intIndex + 1) * theWidth)
}, 1000)
} else if($(this).is(".previous")){
$(this).parent('li').parent('ul').animate({
"margin-left": (-(intIndex - 1) * theWidth)
}, 1000)
} else if($(this).is(".startover")){
$(this).parent('li').parent('ul').animate({
"margin-left": (0)
}, 1000)
}
});//close .bind()
});//close .each()
聲明:
.bind("click", function(){...
檢查鼠標「點擊」事件,然後執行,如果聲明。我希望在不首先點擊的情況下運行if語句。任何幫助將不勝感激,謝謝。