次のコードを使用して、1 ページに複数のスライドハウを作成しています。
スライドショーは問題なく動作しますが、各スライドショーの個々のボタンが機能しません。それらをクリックすると、ページが一番上までスクロールします。各リンクを一意に識別することで、問題は発生しないはずだと考えました。
何が問題なのですか?
$("div.slideshow").each(function(){
$(this).find('ul').carouFredSel
({
auto:true,
items: { width: 200, height: 200 },
prev: { button: function() { return $(this).find('a.prev');}},
next: { button: function() { return $(this).find('a.next'); }},
});
console.log( $(this).find('a.prev') ); //correct element returned, length 1
console.log($(this)); //correct element returned
});