number-flip 介绍
number-flip 是一款 js 数字翻转切换 插件 。该 js 数字翻转切换 插件 可以制作数字切换的动画 效果 ,你可以 自定义 数字类型,使用 中文 或 unicode,来制作类似水果机动画的 效果 。
安装
npm install --save number-flip
使用
import { Flip } from 'number-flip'
new Flip({
node: document.querySelector('.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);
},
// for more easing function,see https://github.com/danro/easing-js/blob/master/easing.js
sy stem Arr: ['零','壹','贰','叁','肆','伍','陆','柒','捌','玖']
})
网站地址 : https://codepen.io/gaoryrt/pen/oyyMBx
GitHub: https://github.com/gaoryrt/number-flip
网站描述: 一款 js 数字翻转切换 插件
number-flip官方网站
官方网站: https://codepen.io/gaoryrt/pen/oyyMBx
如果觉得 网站内容还不错,欢迎将 网站 推荐给程序员好友。
声明:本文来自网络,不代表【好得很程序员自学网】立场,转载请注明出处:http://www.haodehen.cn/did174694