jQuery – plugin – period – 批次讓元素間隔時間執行
jquery.period.js
如果想要「將指定的元素集合,批次間隔固定時間去做一些事情」那麼可以用這支非常簡單的 plugin。
安裝
前往 Github 下載 或是使用 npm 下載
1 2 3 |
npm i jquery.period.js |
載入方式
1 2 3 |
import 'jquery.period.js' |
範例
這個範例是讓所有的 .item 間距 200 毫秒,批次動畫的增加高度。
1 2 3 4 5 6 7 8 9 10 11 12 13 14 |
$(".item").period({ delayTimes: 200, before: function (){ // ... }, todo: function(index){ // ... }, after: function (){ // ... } }) |
我們看實際範例: