原文链接
install
$ npm install --save number-flip
usage
use it!
create one and make it flip:
new Flip({
node: $('.flip'),
from: 9527,
to: 42
})
flip one with delay:
new Flip({
node: $('.flip'),
from: 9527,
to: 42,
delay: 1000
})
create one and flip it later:
const el = new Flip({
node: $('.flip'),
from: 9527
})
el.flipTo({to: 42})
costumize animate duration:
new Flip({
node: $('.flip'),
from: 9527,
to: 42,
duration: 2
})
more complex usage
new Flip({
node: $('.flip'),
from: 73,
to: 25,
duration: 2,
delay: 1,
easeFn: function(pos) {
if ((pos/=0.5) < 1) return 0.5*Math.pow(pos,3);
return 0.5 * (Math.pow((pos-2),3) + 2);
},
systemArr: ['零', '壹', '贰', '叁', '肆', '伍', '陆', '柒', '捌', '玖']
})
TODO
flip with FLIP
browser compatibility list
thresh maybe
license
MIT
contributing
fork this repo
git checkout -b NEW-FEATURE
git commit -am 'ADD SOME FEATURE'
git push origin NEW-FEATURE
flip with FLIP
browser compatibility list
thresh maybe
fork this repo
git checkout -b NEW-FEATURE
git commit -am 'ADD SOME FEATURE'
git push origin NEW-FEATURE
點擊查看更多內容
1人點贊
評論
評論
共同學習,寫下你的評論
評論加載中...
作者其他優質文章
正在加載中
感謝您的支持,我會繼續努力的~
掃碼打賞,你說多少就多少
贊賞金額會直接到老師賬戶
支付方式
打開微信掃一掃,即可進行掃碼打賞哦