求一个模拟模态弹出窗口的例子,不用DIV实现,
主页面中有很多个弹出模态窗口的链接,弹出的窗口是一个JSP,能接收链接里的参数 而显示不同的内容

解决方案 »

  1.   

    2個頁面 一個是 father.htm 還有一個是 son.htmlfather.htm<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"
    "http://www.w3.org/TR/html4/loose.dtd">
    <html>
    <head>
    <meta http-equiv="Content-Type" content="text/html; charset=gb2312">
    <title>爸爸</title><script language="javascript">
    function ShowModal(){
    var txt=document.getElementById("Text1");
    txt.value=window.showModalDialog("son.htm");

    }</script> 
    </head>
    <body>
    name<input id="Text1" type="text" disabled    value=""/><input type="button" value="望远镜" onClick="ShowModal()"/>
    </body>
    </html>
    son.htm<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"
    "http://www.w3.org/TR/html4/loose.dtd">
    <html>
    <head>
    <meta http-equiv="Content-Type" content="text/html; charset=gb2312">
    <title>儿子</title>
    <script language="javascript">
    window.onunload=function(){
                    window.returnValue=document.getElementById("name").value;
    }

    function CloseModal(){
    window.opener=null;
    window.close();
    window.returnValue=document.getElementById("name").value;
    }
    </script>
    </head><body>
    <input id="name" type="text"/>
    <input type="button" value="关 闭" onClick="CloseModal()"/>
    </body>
    </html>
      

  2.   

    打開 father.htm 點擊 “望遠鏡” 的模態頁son.htm 輸入內容 然后關閉 值在 father.htm出現這個小例子 舉一反三 基本上什么都能做了。