【问题标题】:Change parent window location from popup从弹出窗口更改父窗口位置
【发布时间】:2012-07-21 08:06:17
【问题描述】:

我正在尝试制作一些网站,并想问一些问题。 该网站的主文件是 main.asp。 在 main.asp 中,我插入了 notice.jpg 文件作为弹出窗口。

我想这样做,如果我点击弹出窗口,那么弹出窗口消失,新的大窗口(www.charming.or.kr/jeju/)出现。 谁可以帮我这个事? 以下是我的部分来源。

<head>
<meta http-equiv="Content-Type" content="text/html; charset=euc-kr" />
<title><!--#include file="../include/title.asp"--></title>
<style type="text/css">
@import url(../css/comm.css);
</style>
<script language='javascript'> 
function OpenWin(dest) 
{ 
posy = screen.Height/2 - 100; 
posx = screen.Width /2 - 200; 

StartWin = window.open(dest, 
"notice_popup","toolbar=no,channelmode=no,left="+posx+",top="+posy+",location=no,directories=no,w    idth=743,height=720,resizable=no,menubar=no,scroll=no"); 
} 


</script> 

</head>

<body onload="OpenWin('../img/main/Notice.jpg')" > 

【问题讨论】:

    标签: html popup window


    【解决方案1】:

    在您的新窗口中,您可以使用window.opener 引用您的原始窗口,这是对原始窗口的直接引用。因此,您可以使用

    window.opener.location.href = newURL;
    

    【讨论】:

    • 感谢您的好意。请告诉我位置(“window.opener.location.href = newURL;”在哪里
    • 如果你想在用户点击图片时更改 URL,你必须设置一个只包含图片的小 html 页面,并有一个点击处理程序来设置 url。
    猜你喜欢
    • 1970-01-01
    • 2012-12-29
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    相关资源
    最近更新 更多