jQuery 禁止子元素响应父元素点击事件

时间:2021-08-20 15:18:25   收藏:0   阅读:22
    $(‘.zong‘).click(function(e){
        if (e.target == e.currentTarget){//防止父元素覆盖资源的绑定事件操作
            $(this).css({"top":"100%"}); //执行父元素的事件
        }
    })

 

原文:https://www.cnblogs.com/KindJoker/p/15166324.html

评论(0
© 2014 bubuko.com 版权所有 - 联系我们:wmxa8@hotmail.com
打开技术之扣,分享程序人生!