1.0.34 • Published 7 years ago

huyue-touch-event v1.0.34

Weekly downloads
1
License
ISC
Repository
-
Last release
7 years ago

使用说明

方法对touch的信息做了一些搜集

    this.info.x ='0'; //x 轴移动距离;
    this.info.y ='0'; //y 轴移动距离;
    this.info.contX = 0; //X 轴滚动的累加值
    this.info.contY = 0; //Y 轴滚动的累加值
    this.info.isx =''; //x 轴的移动方向
    this.info.isy =''; //y 轴的移动方向
  1. 安装
npm i huyue-touch-event -save
  1. 更新
npm update huyue-touch-event
  1. 引入
import ZSwiperMaker from 'huyue-touch-event'
  1. 使用
        let scrllDom = {
            //非必填 默认 false 是否阻止start,move ,end方法发生默认的行为
            startPreventDefault : false,   
            movePreventDefault : false,
            endPreventDefault : false,
            
            //非必填 默认 false  是否停止start,move ,end事件的传播,阻止它被分派到其他 Document 节点
            startStopPropagation : false, 
            moveStopPropagation : false,
            endStopPropagation : false, 

            //非必填 默认 false  , true事件句柄在捕获阶段执行  false- 事件句柄在冒泡阶段执行
            startBubbling : false, 
            moveBubbling : false,
            endBubbling : false,

            //必填
            dom : $('.div')[0],  //要绑定的dom
            //非必填 touchstart 回调事件
            start: function(res){
                console.log('start',res)
            },
            //非必填 touchmove 回调事件
            move: function(res){
                console.log('move',res)
            },
            //非必填 touchend 回调事件
            end: function(res){
                console.log('end',res)
            }
        }
        let touchInfo  = new ZSwiperMaker(scrllDom)
1.0.34

7 years ago

1.0.33

7 years ago

1.0.31

7 years ago

1.0.3

7 years ago

1.0.2

7 years ago

1.0.1

7 years ago

1.0.0

7 years ago