div
次のボタンをクリックすると、divの次の画像にアニメーション化しようとしている画像がいくつかあります
この div には、アニメーション化したくない前のボタンと次のボタンもあります。
<div class="work">
<a href="#" class="rightButton"><img src="http://www.jamietaylor-webdesign.co.uk/images/home/right.png" /></a>
<a href="#" class="leftButton"><img src="http://www.jamietaylor-webdesign.co.uk/images/home/left.png" /></a>
<a href="#" class="1"><img class="topLeft" src="http://i.stack.imgur.com/JQFbb.jpg" /></a>
<a href="#" class="2"><img class="topRight" src="http://i.stack.imgur.com/l5OPs.jpg" /></a>
<a href="#" class="3"><img class="bottomLeft" src="http://i.stack.imgur.com/okxQz.jpg" /></a>
<a href="#" class="4"><img class="bottomRight" src="http://i.stack.imgur.com/4uPHw.jpg" /></a>
</div>
実際に動作しない私のjQuery
// prevent click jump
$('a').click(function() {
return false;
});
// do work
$('.work > .leftButton').click(function() {
//animate to previous image in the list
$(this).siblings().prev().show();
});
$('.work > .rightButton').click(function() {
//animate to next image in the list
$(this).siblings().next().show();
});
またはのクラスを持たない次の画像にアニメーション化する方法はありますleftButton
かrightButton
。
また、最初の画像にいる場合、div の最後の画像に移動する方法はありますか?
何か案は?