ホバー時にバスケットを上下にジャンプさせるjavascriptアニメーションのあるhrefボタンがあります。ただし、href リンクを入力送信ボタンに変更する必要があり、アニメーションを入力ボタンで正しく動作させることができないようです。
これは私がアニメーションに使用しているjavascriptです
<script type="text/javascript">
$(document).ready(function(){
$(".button").hover(function(){
$(":not(:animated)", this)
// first jump
.animate({top:"-=6px"}, 200).animate({top:"+=6px"}, 200)
// second jump
.animate({top:"-=3px"}, 100).animate({top:"+=3px"}, 100)
// the last jump
.animate({top:"-=2px"}, 100).animate({top:"+=2px"}, 100);
});
})
</script>
これがHTMLです
<div class="addbasketbut">
<a class="button" href="#">
<img src="template_images/basketbutton.png" alt="" />Add to Basket
</a>
</div>
これは元のボタンの動作中の Jsfiddle ですhttp://jsfiddle.net/tcherokee/wkfrG/
私はJqueryの経験があまりないので、どんな助けでも大歓迎です。