事件類型
tap touchstart touchmove touchcancel touchend longtap longpress
transitionend animationstart animationiteration animationend touchforcechange
各種綁定事件方式的區別:
1. bind: 普通綁定(事件會冒泡)
2. catch: 阻止事件冒泡
3. capture-bind: 捕獲階段綁定(后續捕獲流程和冒泡流程會繼續執行)
4. capture-catch: 中斷捕獲階段和取消冒泡階段,在捕獲階段阻止事件的傳遞
三層都以bind的方式綁定,點擊第二層,出現冒泡:
將第二層以catch的方式綁定事件,點擊第二層,會阻止冒泡:
三層都以capture-bind的方式綁定,點擊第三層:
三層都以capture-catch的方式綁定,點擊第三層: