Skip to content

jQuery Effects - 自訂動畫

以下幾個常用的方法,可以自定義動畫效果。

animate()

自行定義 CSS 樣式以進行動畫的製作。

js
animate(properties, duration, complate)

參數

功能說明型別範例備註
propertiesCSS 屬性與值Object{ top: 100, left: 700 }必填
duration效果的速度StringNumber'slow''fast'、400
complete結束後的執行事項Functionfunction() {}

delay()

延遲動畫效果的開始時間。

js
delay(duration)

參數

功能說明型別範例備註
duration效果的速度Number400必填

stop()

停止正在運作的動畫。

js
stop(clearQueue, jumpToEnd)

參數

功能說明型別範例備註
clearQueue清除佇列動畫Booleantruefalse必填
jumpToEnd立即結束動畫Booleantruefalse必填