jQuery click() event catch-all?

前端 未结 2 1410
感动是毒
感动是毒 2020-12-18 23:26

we\'re showing a box on the screen that I want to hide when the user clicks anywhere on the screen, including body, anchors, divs, buttons, etc... Is there a selector that c

2条回答
  •  余生分开走
    2020-12-18 23:46

    You can just bind to the click event of document element. Try it at http://jsfiddle.net/ZqEbY/.

提交回复
热议问题