0
首先,例如JS代码:stopPropagation困境?
$(function(){
$('body').click(function(){alert('body clicked');});
$('body').on('click','.post-header',function(e){
e.stopPropagation();
$(this).next('.post-content').slideToggle();
})
});
<script src="https://ajax.googleapis.com/ajax/libs/jquery/2.1.1/jquery.min.js"></script>
<body>
<div class="post-wrapper">
<h2 class="post-header">Lorem Ipsum</h2>
<div class="post-content">
<p>Lorem Ipsum is simply dummy text of....</p>
</div>
</div>
</body>
我的问题是,如果e.stopPropogation()杀死对身体冒泡,怎么来的单击事件击中身体,并触发处理程序运行幻灯片代码?