The equivalent for onmousedown
on touchscreen devices is ontouchstart
, and the equivalent of onmouseup
is ontouchend
.
If you would also like to detect dragging, you could use ontouchmove
which is fired every time you move your finger after touching the screen.
More Related Contents:
- Javascript for “Add to Home Screen” on iPhone?
- Fixed positioning in Mobile Safari
- iScroll 4 not working with form element iPhone Safari and Android browser
- Is there any way to use window.onbeforeunload on Mobile Safari for iOS devices?
- How to detect in iOS webapp when switching back to Safari from background?
- Preventing default context menu on longpress / longclick in mobile Safari (iPad / iPhone)
- Strange behavior of select/dropdown’s onchange() JS event when using ‘Next’ on Mobile Safari Dropdown list item select box
- Determine if user navigated from mobile Safari
- Available iPhone Web Application JavaScript UI Library/Frameworks
- Javascript date parsing on Iphone
- Is Safari on iOS 6 caching $.ajax results?
- Detect a finger swipe through JavaScript on the iPhone and Android
- $(document).click() not working correctly on iPhone. jquery [duplicate]
- Force link to open in mobile safari from a web app with javascript
- How to open a native iOS app from a web app
- Programmatically selecting text in an input field on iOS devices (mobile Safari)
- How to detect a long touch pressure with javascript for android and iphone?
- What is the best method of re-rendering a web page on orientation change?
- Geolocation API on the iPhone
- Difference between onbeforeunload and onunload
- Total canvas memory use exceeds the maximum limit (Safari 12)
- NSString in UIWebview
- Mobile Safari on iOS crashes on big pages
- How do I hide the address bar on iPhone?
- How to open Safari from a WebApp in iOS 7
- Detect if page is loaded inside WKWebView in JavaScript
- Is it possible, in JavaScript, to detect when the screen is turned off in the Android & iOS browsers
- Handling standby on iPad using Javascript
- EXIF Orientation Issue in Safari Mobile
- How do I put a clear button inside my HTML text input box like the iPhone does?