1
我可以檢查是否mousedown
已被觸發,像這樣:如果事件類型等於touchstart
$(something).on("mousemove touchmove", function(e) {
if (e.buttons == 1){
// mouse is down
}
})
很簡單的問題,我怎麼能檢查是否touchstart
已經在上面被觸發?我試過了:
if (e.type === 'touchstart'){
// touchstart has been triggered
}
現在確實可以工作了。有人可以提供關於如何實現這一目標的方向嗎?
我的目的是檢查touchstart,因爲我想知道用戶是否在觸摸設備上滑動。我剛剛在Windows手機上檢查過它,它很有用,謝謝! –
沒問題,很樂意幫忙。 –