-
-
Save codingwithsara/da58f4858df3bfbad58118b6ad2a8652 to your computer and use it in GitHub Desktop.
【jQuery】テーブル Tr 行を動的に追加・削除・並び替え・値を取得する方法 - スマホ対応
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
function simulateMouseEvent (event, simulatedType) { | |
// Ignore multi-touch events | |
if (event.originalEvent.touches.length > 1) { | |
return; | |
} | |
//event.preventDefault(); | |
var touch = event.originalEvent.changedTouches[0], | |
simulatedEvent = document.createEvent('MouseEvents'); | |
if ($(touch.target).is('input') || $(touch.target).is('textarea')) { | |
event.stopPropagation(); | |
} else { | |
event.preventDefault(); | |
} | |
// Initialize the simulated mouse event using the touch event's coordinates | |
simulatedEvent.initMouseEvent( | |
simulatedType, // type | |
true, // bubbles |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment