var animate = require('../../utils/animate.js');
参数3 time:动画执行时间 。 默认值400ms
wxml中调用方法:animation='{{param}}'
<view animation='{{param}}'></view>
onReady:function(){
let that=this;
animate.hide(that,that.data.param,1);//使用的元素需要先用hide方法隐藏
setTimeout(function(){
animate.hide(that,that.data.param,500);
},500)
}
参数3 time:动画执行时间 。 默认值400ms
wxml中调用方法:animation='{{param}}'
<view animation='{{param}}'></view>
onReady:function(){
let that=this;
animate.hide(that,'pram',1);//使用的元素需要先用hide方法隐藏
}
isMove(e,direction,callback)
*参数2 direction:往哪个方向滑动触发('left','right','top','bottom');
<view bind:touchmove="isMove"></view>
isMove:function(e){
let that=this;
animate.isMove(e,'left',()=>{
//如果向左滑动则触发
},this)
}
*参数2 callback:回调 返回目标left,right,top,bottom属性;
onReady:function(){
animate.getHeight('ddd',(res)=>{
consonle.log(res)
})
}
getNode(name,arr,callback)
*参数1 name:节点名 '#ddd'/'.aaa';
backgroundColor,color,fontSize,height,margin,padding,scrollHeight,scrollLeft,scrollTop,scrollWidth,width;如果想获取的属性这里没有可以填写在arr里
onReady:function(){
animate.getNode('#ddd',['border'],(res)=>{
consonle.log(res)
})
}
*参数2 callback:回调 返回图片基本信息
onReady:function(){
animate.getWxImg('https://pic2.zhimg.com/50/v2-88fd57c6464e1a313d5c3337aba07458_hd.jpg',(res)=>{
consonle.log(res)
})
}
参数2 len:在长度大于多少时开始分割 默认:1
onReady:function(){
let str='adadaadaddad'
let newStr=animate.strSm(str,5);
//[adada,adadd,ad]
}
fontEllipsis(str,len,end)
参数2 len:在长度大于多少之后为省略号 默认为5
onReady:function(){
let str='adadaadaddad'
let newStr=animate.fontEllipsis(str,5,'???');
//'adada???'
}