Tôi đang sử dụngDịch touch sự kiện từ Javascript để jQuery
window.addEventListener("touchstart", function(ev){
console.log(ev.touches); // good
});
Làm thế nào tôi có thể dịch này để jQuery? Tôi đã thử:
$(window).bind("touchstart",function(ev){
console.log(ev.touches); // says ev.touches is undefined
}
Bất kỳ ý tưởng nào?
cảm ơn, tương đối mới đối với trang web. vừa quay lại và chấp nhận câu trả lời tốt. – K2xL
Không phải lo lắng. Rất vui khi bạn tìm ra mọi thứ :) –
Một thư viện jQuery đơn giản: https://github.com/Tundra-Interactive/swipe.jquery.js –