🚀 Socket Launch Week Day 5:Introducing Repository Access Permissions and Custom Roles.Learn more
Sign In

domhammer

Package Overview
Dependencies
Maintainers
1
Versions
3
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

domhammer

控制DOM结构移动、缩放、旋转的集成方法,支持鼠标开启部分功能操作;Move, zoom, rotate the mobile device DOM element, then output the total amount of change.Pc device partial support.

latest
npmnpm
Version
1.0.3
Version published
Maintainers
1
Created
Source

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>

Keywords

mobile

FAQs

Package last updated on 09 Oct 2019

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts