1
スライディングパネルがあり、最後の要素でアニメーションを止めたいのですが、.is( ':last')を使って試してみましたが、停止しません。ここに私のコードです。フォームがロードされると、現在のvarが最初の要素に設定されます。それは左にアニメーション化し、あなたは私だけ最後の要素のアニメーションを停止します
jQuery('.wikiform .navigation input[name^=Next]').click(function() {
if (current.is(':last')) return;
jQuery('.wikiform .wizard').animate({ marginLeft: '-=' + current.width() + "px" }, 750);
current = current.next();});
<div id="formView1" class="wikiform">
<div class="wizard">
<div id="view1" class="view">
<div class="form">
Content 1
</div>
</div>
<div id="view2" class="view">
<div class="form">
Content 2
</div>
</div>
</div>
<div class="navigation">
<input type="button" name="Back" value=" Back " />
<input type="button" name="Next " class="Next" value=" Next " />
<input type="button" name="Cancel" value="Cancel" />
</div>
</div>
大変うまくいった – ONYX