快速jQuery问题:停止事件传播? [英] Quick jQuery question: Stopping event propagation?

查看:87
本文介绍了快速jQuery问题:停止事件传播?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有一组响应mouseUp事件的元素,其中还包含响应mouseUp事件的子元素(通过jQuery)。当一个孩子的mouseUp事件发生在一个用户的鼠标上时,如何做到这一点呢点击这个孩子的父亲的mouseUp事件也不会发生在jQuery?

I have a set of elements that respond to mouseUp events, and inside of them are child elements that respond to mouseUp events as well (all via. jQuery). How do I make it so when a child's mouseUp event occurs from a user mouse click the child's parent's mouseUp event doesn't also occur in jQuery?

推荐答案

您希望 event.stopPropagation()

这篇关于快速jQuery问题:停止事件传播?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆