在下面预加载时可以对左右滑动到开关进行关闭js代码
mui.plusReady(function() { //mui('.mui-slider').slider().setStopped(true); //禁止左右滑动关闭 mui('.mui-scroll-wrapper').scroll({ deceleration: 0.0005 //flick 减速系数,系数越大,滚动速度越慢,滚动距离越小,默认值0.0006 }); //mui-scroll-wrapper1左滑动监听 document.getElementById('mui-scroll-wrapper1').addEventListener("swiperight", function() { document.getElementById('xinzengMx').classList.add("mui-hidden"); document.getElementById('mingxi').classList.remove("mui-active"); document.getElementById('jibenxiangqing').classList.add("mui-active"); }); //mui-scroll-wrapper2右滑动监听 document.getElementById('mui-scroll-wrapper2').addEventListener("swipeleft", function() { if(isactive == 'null' || !isactive) { document.getElementById('xinzengMx').classList.remove("mui-hidden"); } document.getElementById('jibenxiangqing').classList.remove("mui-active"); document.getElementById('mingxi').classList.add("mui-active"); }); });html代码
###########MUI集成了很多手势事件,单击、长按、滑动等等。
点击事件:1. tap 单击屏幕2. doubletap 双击屏幕长按事件:1. longtap 长按屏幕2. hold 按住屏幕(为什么我想起了顶住屏幕)。。。3.release 离开屏幕滑动事件:1. swipeleft 向左滑动2. swiperight 向右滑动3. swipeup 向上滑动4. swipedown 向下滑动拖动事件:1. drastart 开始拖动2.drag 拖动中3. dragend 拖动结束
根据使用频率,mui默认会监听部分手势事件,如点击、滑动事件;为了开发出更高性能的moble App,mui支持用户根据实际业务需求,通过mui.init方法中的gestureConfig参数,配置具体需要监听的手势事件
注意:dragstart、drag、dragend 共用drag开关、swipeleft 、swiperight 、swipeup 、swipedown 共用swipe开关
关注公众号,回复c+兴趣的东西 24小时内即可领取学习。2T资料任君挑选!
转载于:https://www.cnblogs.com/wwwcf1982603555/p/10037562.html
