问题标签 [stoppropagation]
For questions regarding programming in ECMAScript (JavaScript/JS) and its various dialects/implementations (excluding ActionScript). Note JavaScript is NOT the same as Java! Please include all relevant tags on your question; e.g., [node.js], [jquery], [json], [reactjs], [angular], [ember.js], [vue.js], [typescript], [svelte], etc.
jquery - 无法在向下切换框内获得花式框链接
这是我的问题。我编写了一些自定义 jquery 来切换我网站上的登录表单。然后,我添加了一些我在此处找到的代码,如果您单击它来关闭该框。
问题出现了,因为我有一个链接到这个 div 内的一个花式框,它可以切换进/出。因为我event.stopPropagation();
与点击一起使用,所以它与那个fancybox链接混淆了。完整的代码示例如下。
如果我取出 stopPropagation,一切都按预期工作(fancybox 按钮有效),我只是失去了通过在登录框外部单击来关闭登录框的能力。任何人都可以帮助我用一种更聪明的方式来编写它,而不会破坏fancybox的功能吗?
javascript - 固定 div 中的 div 是否会捕获鼠标点击?
我正在使用这个模态窗口的一个稍微修改过的版本:http: //blog.avtex.com/2012/01/26/cross-browser-css-only-modal-box/
我所做的修改之一是添加onclick="history.back(-1)"
到覆盖和垂直偏移 div,以便通过单击外部来隐藏模式。但是,将 onclick 事件添加到垂直偏移 div 会捕获发生在 dimBox div 上的点击。
你可以看看这个 jsFiddle 看看发生了什么:http: //jsfiddle.net/dvrcthewrld/uaP3v/1/
我怎样才能让dumbBox div捕捉其中发生的那些点击,而不是垂直偏移div捕捉它们?
[请不要使用 jQuery。]
我真的很想知道为什么内部 div 将点击事件传递给父级以及如何阻止它。
javascript - 停止传播
我有一个面板,通过单击带有 class 的元素来打开和关闭以显示菜单.open
。当我第一次单击它时,很好,面板打开了。面板打开后,我单击一个菜单项,然后面板关闭。
我面临的问题是,单击菜单项后关闭面板后,我需要点击两次.open
才能再次打开面板。
我首先运行这个:
这会打开一个带有菜单的面板,然后当我单击一个菜单项时,我会这样做:
是传播的问题吗?添加:
仍然给我留下同样的问题。
jquery - StopPropogation - 无法禁用父锚标记
我目前正在尝试更改单击时子元素的颜色。父元素链接到另一个页面。我希望 stopPropogation 会起作用,但事实并非如此。以下是我的 jQuery 代码:
如果重要的话,锚标签会围绕祖父母。
我哪里错了?
jquery - 当处理程序已经存在并绑定时,.live() 上的 JQuery stopPropagation
我知道现场电话会通过文档冒泡,这就是我遇到问题的原因。
不幸的是,我正在使用绑定元素的第三方库,并希望创建一个点击事件不会冒泡到这些元素的案例。
将 .click() 与 eventStopPropogation 结合使用效果很好,但是由于内容的动态特性,我需要使用 live、on、delegate 等...这是我的问题的一个小问题。单击“内部” div 时,我需要防止触发“外部”单击。我无法更改“外部”处理程序。
在此先感谢您的帮助!!
HTML:
Javascript:
jquery - 当处理程序已经存在时,.live() 上的 JQuery stopPropagation
我知道现场电话会通过文档冒泡,这就是我遇到问题的原因。
不幸的是,我正在使用将事件处理程序绑定到元素的第三方库,并希望创建一个点击事件不会冒泡到这些元素的案例。
将 .click() 与 eventStopPropagation() 结合使用效果很好,但是由于内容的动态特性,我需要使用 live、on、delegate 等......这是我的问题的一个小问题。单击“内部” div 时,我需要防止触发“中间”单击。我无法更改“中间”处理程序(最好是您认为我什至无权访问它)。
在此先感谢您的帮助!!抱歉重复了,我认为这样会更整洁。
HTML:
Javascript:
ajax - stop propagation of an ajax action-link in asp .net mvc
I have a table in my code with action links to make updates and deletes of some data. And this table is inside a div that has to change when i make the updates or deletes.
The problem is: when i click those actionlinks, i have some ajax propagation. I tried to stop that propagation linking the click event with the jquery method stopPropagation. And it works, but when the page loads, it loads only with the elements of the partial view. So i have no order in the elements, and it does not use the layout. Even, the url changes into the one specified in the ajax options of the actionlink. When i do not use the stop propagation, it works well and all the elements loads well, using the layout, but the propagation exists (the more i use the page, it gets slower, so is a problem)
View Page:
Partial View with the table:
And Finally the javascript in the Partial View:
jquery - 当我添加这个 stopPropagation 函数时,显示值的函数停止工作
我正在使用 unordered () HTML 列表设置一些 MultiSelect 元素的样式,但是当我添加最新的函数(单击另一个元素时关闭容器)时,另一个函数停止工作 - 显示复选框值的函数检查。
完整代码的小提琴在这里:http: //jsfiddle.net/chayacooper/ezxSF/19/
我要添加的功能
原始功能
HTML
jquery - 单击输入时数据表行分组停止扩展
使用数据表和行分组我试图让行在单击输入时不展开..但仅在单击 tr 时展开。 .stopPropagation()
不工作。
我正在使用.live()
,因为该表是由 ajax 动态创建的。
这是一个jsfiddle:http: //jsfiddle.net/JWvZt/
javascript - 为什么 event.stopImmediatePropagation() 在除 IE 之外的所有浏览器中都有效?
经过一些测试后,我注意到这event.stopImmediatePropagation()
在 IE 中不起作用(按照下面的用法)。但是,它适用于 Chrome、Firefox、Safari 和 Opera。是什么赋予了?
请参阅此小提琴以在 IE 中重现(在其他浏览器中测试小提琴以使其正常工作)。
小提琴Javascript:
小提琴html: