MCPcopy Create free account
hub / github.com/Vishal-raj-1/Awesome-JavaScript-Projects / getPositionX

Function getPositionX

assets/js/clickanddrag.js:39–41  ·  view source on GitHub ↗
(event)

Source from the content-addressed store, hash-verified

37}
38
39function getPositionX(event) {
40 return event.type.includes('mouse') ? event.pageX : event.touches[0].clientX
41}
42
43// use a HOF so we have index in a closure
44function touchStart(index) {

Callers 2

touchStartFunction · 0.85
touchMoveFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected