Warning: file_get_contents(/data/phpspider/zhask/data//catemap/2/joomla/2.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Javascript DHTML模式窗口,后台关闭,单击_Javascript_Popup_Dhtml - Fatal编程技术网

Javascript DHTML模式窗口,后台关闭,单击

Javascript DHTML模式窗口,后台关闭,单击,javascript,popup,dhtml,Javascript,Popup,Dhtml,我正在使用在此处找到的dhtml窗口小部件脚本: 我希望用户能够关闭dhtml弹出窗口时,点击背景。目前,它仅在单击“关闭”按钮时起作用。如何将其添加到这个脚本中?这个小部件现在已经很旧了(超过6年),毫无疑问,有很多更新、更好的替代品,但这不是重点 链接页面上的文档详细说明了如何创建弹出窗口,以及如何访问作用于弹出窗口的功能。复制如下以供参考: Create links that manipulate an opened window in various ways when clicked

我正在使用在此处找到的dhtml窗口小部件脚本:


我希望用户能够关闭dhtml弹出窗口时,点击背景。目前,它仅在单击“关闭”按钮时起作用。如何将其添加到这个脚本中?

这个小部件现在已经很旧了(超过6年),毫无疑问,有很多更新、更好的替代品,但这不是重点

链接页面上的文档详细说明了如何创建弹出窗口,以及如何访问作用于弹出窗口的功能。复制如下以供参考:

Create links that manipulate an opened window in various ways when clicked on

<script type="text/javascript">
// this function invocation generates the popup with your specific parameters
// the variable name you assign (googlewin) is used to interact with the popup later
var googlewin=dhtmlwindow.open("googlebox", "iframe", "http://google.com", "Google Web site", "width=700px,height=450px,resize=1,scrolling=1,center=1", "recal")
</script>

<!-- this is an example link that will call the close method on the googlewin object
this is the bit you need to apply to whatever it is that you want the visitor to be able to click on to close the popup -->
<a href="#" onClick="googlewin.close(); return false">Close Window</a>
创建链接,在单击时以各种方式操纵打开的窗口
//此函数调用生成带有特定参数的弹出窗口
//您指定的变量名(googlewin)用于稍后与弹出窗口交互
var googlewin=dhtmlwindow.open(“googlebox”、“iframe”和http://google.com“,”谷歌网站“,”宽度=700px,高度=450px,大小=1,滚动=1,中心=1,“重铸”)

请记住,您使用的小部件会创建一个弹出窗口,而不是真正的模式。如果要使用模式(lightbox),则当访问者单击主模式内容区域之外的任何位置时,都会内置关闭功能。

这不是主题所说的“DHTML模式”。这是给“dhtmlwindow”的。有一点不同,因为“dhtmlmodal”似乎没有.close()事件,只有.hide()

添加一个div元素,该元素延伸整个视图端口的宽度和高度,并位于窗口后面,然后添加一个onclick侦听器并调用close按钮调用的方法。如果你遇到麻烦,发布你的代码…对不起,我是个新手。我发布了代码的链接。我正在使用window3选项。JS文件在那里可以查看。如何使用这些函数t.hide=function(){dhtmlwindow.hide(this)}//用于隐藏dhtml窗口的公共函数t.close=function(){dhtmlwindow.close(this)}//用于关闭dhtml窗口的公共函数(也清空dhtml窗口内容)是的,我知道如何创建它。我想问的是,是否可以添加在弹出窗口外单击时关闭该窗口的功能,如lightbox图像窗口。目前,它只在弹出窗口中的链接上工作。它不是弹出窗口,而是浏览器窗口中的模式。