TransitionEnd listener firing on child elements

前端 未结 2 1638
谎友^
谎友^ 2021-02-20 07:35

I added a transitionend event listener to a div. This div has children who have transition on some elements. I want the transitionend even

2条回答
  •  温柔的废话
    2021-02-20 08:28

    This process is called as Event Bubbling.The thing you can do is either detect the bubbling using the event handler or prevent the bubbling by stopping the propogation. You can do this by

    event.stopPropagation()
    

    In IE beofore 9.

    You can do it as

    window.event.cancelBubble = true;
    

    Please have a detailed look here

提交回复
热议问题