Home
Docs
GitHub
Pricing
Blog
Log In

Run Sandworm Audit for your App

Get started
Generated on Apr 21, 2024 via pnpm

hammerjs 2.0.8

A javascript library for multi-touch gestures
Package summary
Share
0
issues
1
license
1
MIT
Package created
27 Feb 2013
Version published
22 Apr 2016
Maintainers
2
Total deps
1
Direct deps
0
License
MIT

Issues

0
This package has no issues

Licenses

MIT License

Permissive
OSI Approved
This is a human-readable summary of (and not a substitute for) the license. Disclaimer.
Can
commercial-use
modify
distribute
sublicense
private-use
Cannot
hold-liable
Must
include-copyright
include-license
1 Packages, Including:
hammerjs@2.0.8
Disclaimer

This deed highlights only some of the key features and terms of the actual license. It is not a license and has no legal value. You should carefully review all of the terms and conditions of the actual license before using the licensed material.

Sandworm is not a law firm and does not provide legal services. Distributing, displaying, or linking to this deed or the license that it summarizes does not create a lawyer-client or any other relationship.

Direct Dependencies

0
All Dependencies CSV
β“˜ This is a list of hammerjs 's direct dependencies. Data on all dependencies, including transitive ones, is available via CSV download.
NameVersionSizeLicenseTypeVulnerabilities

Visualizations

Frequently Asked Questions

What does hammerjs do?

Hammer.js is a powerful JavaScript library primarily utilized for handling multi-touch gestures. With its robust and flexible framework, it offers developers an easy-to-use solution for managing touch, mouse, and pointerEvents. It's perfect for when you need to create a more interactive and seamless user experience on your web application or site, particularly on mobile or touch-enabled devices.

How do you use hammerjs?

Using Hammer.js is straightforward and simple. Firstly, you will need to get a reference to an HTML element. With this reference, you can then create a manager for that element. Following this, you define a gesture recognizer - let's say for instance, a 'rotate' gesture. Once defined, you can then add this recognizer to the manager you created. Subsequently, subscribe to events on the manager to execute corresponding actions when these gestures are detected.

Here is a basic example:

// get a reference to an element
var stage = document.getElementById('stage');

// create a manager for that element
var mc = new Hammer.Manager(stage);

// create a gesture recognizer
var Rotate = new Hammer.Rotate();

// add the recognizer to the manager
mc.add(Rotate);

// subscribe to events on the manager
mc.on('rotate', function(e) {
    // action to be executed when rotate event is detected
    var rotation = Math.round(e.rotation);    
    stage.style.transform = 'rotate('+rotation+'deg)';
});

For a more advanced usage of the package, you can check out this demo.

Where are the hammerjs docs?

For a comprehensive guide and detailed explanations of the capabilities of Hammer.js, you can visit the official documentation. Here, you will find all the information you need, from getting started, to using advanced features for creating complex touch-based interfaces.