Home  >  Article  >  Web Front-end  >  js click elsewhere on the page to close the pop-up layer (sample code)_javascript skills

js click elsewhere on the page to close the pop-up layer (sample code)_javascript skills

WBOY
WBOYOriginal
2016-05-16 17:07:371154browse

复制代码 代码如下:




无标题文档






event,'pop');">弹出按钮




总结:

1.在调用弹出方法的时候要传入一个事件对象:event。

2.弹出方法要加入事件绑定代码。

3.要有个全局的js代码,用来执行点击其他部位的时候调用隐藏弹出层的方法。

Statement:
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn