-1
我在尝试创建非点击型div时遇到了问题。stopPropagation()停止传播错误
是的,它的繁殖停止,但停止什么不应该停止,也不会停止我应该停止
JS
//screen has set stopPropagation
$("#smokeScreen").click(function(){
event.stopPropagation();
})
HTML
<div id="content">
<!-- lots of stuff that has to not be clickable while "smokeScreen is visible" -->
<!-- lots of stuff that has to not be clickable while "smokeScreen is visible" -->
<div id="smokeScreen">
<!-- covers whole viewport -->
<div id="form"><!-- another form stuff here --></div>
<!-- covers whole viewport -->
</div>
<!-- lots of stuff that has to not be clickable while "smokeScreen is visible" -->
<!-- lots of stuff that has to not be clickable while "smokeScreen is visible" -->
</div>
有趣的是,这段代码让所有的东西都可以点击,除了形式...
那么请,任何提示?
和指针事件:无;在CSS是不是一个解决方案,出于某种原因,它不工作为简单的CSS,我还没有想到为什么,但我需要保持与旧浏览器的兼容性,这是非常新的声明。
'event'没有定义 –
@PranavCBalan雅,在FF –
提供[MCVE](http://stackoverflow.com/help/MCVE)。你绑定了任何“形式”后代事件还是什么? –