Files
coloruicss/pages/animation/animation.js
weilanwl 5c5f804b9c 晓港
新增动画模块
2018-09-14 17:35:01 +08:00

61 lines
1009 B
JavaScript

Page({
data: {
list: [{
name: 'fade',
color: 'primary'
},
{
name: 'scale-up',
color: 'success'
},
{
name: 'scale-down',
color: 'warning'
},
{
name: 'slide-top',
color: 'danger'
}, {
name: 'slide-bottom',
color: 'primary'
},
{
name: 'slide-left',
color: 'success'
},
{
name: 'slide-right',
color: 'warning'
},
{
name: 'shake',
color: 'danger'
}
],
toggleDelay: false
},
toggle: function (e) {
console.log(e);
var anmiaton = e.currentTarget.dataset.class;
var that = this;
that.setData({
animation: anmiaton
})
setTimeout(function () {
that.setData({
animation: ''
})
}, 1000)
},
toggleDelay: function () {
var that = this;
that.setData({
toggleDelay: true
})
setTimeout(function () {
that.setData({
toggleDelay: false
})
}, 1000)
}
})