2021年10月5日

js 事件防止冒泡 event.stopPropagation()

摘要: <div id="app"> <button id="btn">click</button> </div> const btn = document.getElementById('btn'); btn.addEventListener('click', function(event){ event 阅读全文

posted @ 2021-10-05 02:26 In-6026 阅读(44) 评论(0) 推荐(0)

mouseout和mouseleave的区别

摘要: mouseleave事件是各元素各自触发,不是由子元素冒泡而来,而mouseout是由子元素冒泡而来。 ####举个栗子 .app1 { width: 300px; height: 300px; border: 1px dashed black; } .app2 { width: 200px; he 阅读全文

posted @ 2021-10-05 02:07 In-6026 阅读(98) 评论(0) 推荐(0)

导航