移动端的click事件

    xiaoxiao2021-03-25  133

    <!DOCTYPE html> <html> <head> <title></title> </head> <body> <script type="text/javascript" src="jquery-2.2.3-unzip.js"></script> <script type="text/javascript"> $(document).on('touchstart', () => { console.log('touchstart'); }) $(document).on('touchmove', () => { console.log('touchmove'); }) $(document).on('touchend', () => { console.log('touchend'); }) $(document).on('click', () => { console.log('click'); }) </script> </body> </html>

    移动端下, 当点击页面到释放鼠标时,事件触发的过程是 touchstart touchend click

    当点击页面然后拖拽再到释放鼠标时,事件触发的过程是 touchstart touchmove touchend

    转载请注明原文地址: https://ju.6miu.com/read-7509.html

    最新回复(0)