1.0.3 • Published 5 years ago

domhammer v1.0.3

Weekly downloads
3
License
ISC
Repository
-
Last release
5 years ago

domhammer.js

It is an external method that integrates the functionality of the hammer.js. It is mainly used in mobile touch device, and the pc devices also supports incomplete functions.Provides output of the total output value of the moving, scaling and rotating functions of the selected element object on the DOM structure.The zoom function on the pc device is turned off by default. If you need to enable the parameter to be set to (true), the premise is that there is support for the mouse scroll event.

  • There must be a hammerjs dependency package in the module, and there is no need to require it again in the process of project development.

  • In order to achieve good device compatibility, the js startup file can add the screen-pl requirement module.

  • System Support: Mobile browser kernel Android4.4+ 、ios ;Pc browser kernel webkit、Chrome、Gecko...

Install

npm install domhammer --save

Usage

Add the requirement JS library file to the code,The output is a method that provides three parameters [obj, callbakck, boolean].Obj is the object chosen to run,Callback is the result of the return after running. Boolean is a unique parameter of the pc device, Controls the scaling of the obj mouse scroll event.This js also provides a method of destroying destroy(obj).

###JavaScript:

let domhammer= require('domhammer');

let obj = document.querySelector('div');

	domhammer(obj,function(res){
        console.log(res)
    });

###html:

<body>
	<div></div>
</body>