jQuery实现元素外的操作

html

<div>点击div区域外隐藏此元素</div>

jQuery

$(document).bind('click',function(){
  $('div').hide()
})

$('div').bind('click',function(event){
  event.stopPropagation()
})

  

 

posted @ 2017-01-09 11:41  inkScholar  阅读(110)  评论(0)    收藏  举报