相关疑难解决方法(0)

当用户在其外部单击时,使用jQuery隐藏DIV

我正在使用此代码:

$('body').click(function() {
   $('.form_wrapper').hide();
});

$('.form_wrapper').click(function(event){
   event.stopPropagation();
});
Run Code Online (Sandbox Code Playgroud)

这个HTML:

<div class="form_wrapper">
   <a class="agree" href="javascript:;">I Agree</a>
   <a class="disagree" href="javascript:;">Disagree</a>
</div>
Run Code Online (Sandbox Code Playgroud)

问题是我在DIV内部有链接,当它们点击时它们不再有效.

html jquery styling hide

939
推荐指数
18
解决办法
69万
查看次数

标签 统计

hide ×1

html ×1

jquery ×1

styling ×1