20-jQueryでのアニメーション

826 ワード

jQueryでのアニメーション
表示と非表示の制御

show()  “fast”:200  “normal”:400    “slow”:600
hide()



不透明度の制御(Control Opacity)
fadeIn()
fadeOut()
fadeTo()    //$(“div”).fadeTo(“fast”,”0.2”);



せいぎょこうど
slideUp()
slideDown()
       



カスタムアニメーションの実装
animate(params,speed,fun);
累加、累減アニメーション
$("#btn").click(function(){
    $("#pos").animate({left:"+=20px"},fast);
})


複数のアニメーションを同時に実行
$("#pos").animate({left:"+=20px",height:"+=20px"},fast);


アニメーションを停止
stop()  :       。
stop(true)  :              。


要素がアニメーション状態であるかどうかを判断する
$("#ele").is(":animated")
  :
        。