Comparing version 1.2.0 to 1.2.1
{ | ||
"name": "panzoom", | ||
"version": "1.2.0", | ||
"version": "1.2.1", | ||
"description": "Pan and zoom SVG elements", | ||
@@ -5,0 +5,0 @@ "main": "index.js", |
@@ -81,4 +81,22 @@ # panzoom | ||
## Ignore mouse wheel | ||
Sometimes zooming interferes with scrolling. If you want to alleviate it you | ||
can provide a custom filter, which will allow zooming only when modifier key is | ||
down. E.g. | ||
``` js | ||
panzoom(document.getElementById('g4'), { | ||
beforeWheel: function(e) { | ||
// allow wheel-zoom only if altKey is down. Otherwise - ignore | ||
var shouldIgnore = !e.altKey; | ||
return shouldIgnore; | ||
} | ||
}); | ||
``` | ||
See [JSFiddle](https://jsfiddle.net/Laxq9jLu/) for the demo. The tiger will be | ||
zooomable only when `Alt` key is down. | ||
# license | ||
MIT |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
119596
102