Security News
Opengrep Emerges as Open Source Alternative Amid Semgrep Licensing Controversy
Opengrep forks Semgrep to preserve open source SAST in response to controversial licensing changes.
org.webjars.npm:mouse-event-offset
Advanced tools
Computes the [ offsetX, offsetY ]
from a mouse or touch event, relative to the top left of the target
element.
var offset = require('mouse-event-offset')
window.addEventListener('touchstart', function (ev) {
var target = ev.currentTarget
var touch = ev.changedTouches[0]
var pos = offset(touch, target)
//=> [ 128, 52 ]
})
position = offset(event, [target], [out])
Pass a MouseEvent or TouchEvent as event
.
Optionally, you can specify a target
element which the touch event should be relative to. Defaults to event.currentTarget
, falling back to event.srcElement
for older IE.
You can also specifiy out
to store the position in that array, and avoid creating a new one.
3.x
new version; simpler API, less assumptions, avoids GC thrashing2.x
uses ev.currentTarget
instead of ev.target
1.x
simple implementation using ev.target || ev.srcElement
MIT, see LICENSE.md for details.
FAQs
WebJar for mouse-event-offset
We found that org.webjars.npm:mouse-event-offset demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 0 open source maintainers collaborating on the project.
Did you know?
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.
Security News
Opengrep forks Semgrep to preserve open source SAST in response to controversial licensing changes.
Security News
Critics call the Node.js EOL CVE a misuse of the system, sparking debate over CVE standards and the growing noise in vulnerability databases.
Security News
cURL and Go security teams are publicly rejecting CVSS as flawed for assessing vulnerabilities and are calling for more accurate, context-aware approaches.