如何在IE7下弹出模式窗口?

解决方案 »

  1.   

    用Createpopup试试
    http://msdn2.microsoft.com/en-us/library/ms536392.aspx
      

  2.   

    DIV 该怎么实现这样的效果?
      

  3.   

    ie7好像限制弹出窗口,所以不如用div来模拟一个窗口,比如<!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>show</title>
    <style type="text/css">
    #show{
     display:none;
     margin:0px auto;
     background-color:#999999;
    }
    #txt{
     width:760px;
     height:30px;
     margin:0px auto;
     background-color:#efefef;
    }
    </style>
    </head>
    <body>
    <div id=show>
    </div>
    <div id=txt>
    <a href="#" onClick="show()">Open</a> <a href="#" onClick="show2()">Close</a>
    </div>
    <script type="text/javascript">
    function show(){
    if (!document.getElementById) return false;
    if (!document.getElementById("show")) return false;
    var show = document.getElementById("show");
    show.style.width = "0px";
    show.style.height = "0px";
    show.style.display = "block";
    movement = setTimeout("animation()",0)
    }
    function animation(){
     if (!document.getElementById) return false;
     if (!document.getElementById("show")) return false;
     var show = document.getElementById("show");
     var xpos = parseInt(show.style.width);
     var ypos = parseInt(show.style.height);
      if (xpos == 760 && ypos == 420){
     return true;
     }
      if (xpos < 760){
     xpos+=10
     }
     if (xpos > 760){
     xpos-=10
     }
     if (ypos < 420){
     ypos+=10
     }
     if (ypos > 420){
     ypos-=10
     }
      show.style.width = xpos + "px";
     show.style.height = ypos + "px";
     movement = setTimeout("animation()",0);
    }
    function show2(){
    if (!document.getElementById) return false;
    if (!document.getElementById("show")) return false;
    var show = document.getElementById("show");
    show.style.width = "760px";
    show.style.height = "420px";
    show.style.display = "block";
    movement = setTimeout("animation2()",0)
    }
    function animation2(){
     if (!document.getElementById) return false;
     if (!document.getElementById("show")) return false;
     var show = document.getElementById("show");
     var xpos = parseInt(show.style.width);
     var ypos = parseInt(show.style.height);
      if (xpos == 0 && ypos == 0){
     return true;
     }
      if (xpos < 0){
     xpos+=10
     }
     if (xpos > 0){
     xpos-=10
     }
     if (ypos < 0){
     ypos+=10
     }
     if (ypos > 0){
     ypos-=10
     }
      show.style.width = xpos + "px";
     show.style.height = ypos + "px";
     movement = setTimeout("animation2()",0);

    </script>
    </body>
    </html> 
      

  4.   

    windown.open 
    状态栏 工具栏参数可以设置啊
      

  5.   

    你确定你需要的真的是"模式窗口"么???
    IE7弹出模式窗口和IE6完全相同,一点区别也没有. IE7并不会屏蔽模式窗口(压根屏蔽不了,除非禁用脚本)
    除非你说的并不是模式窗口,而是普通的弹出窗口.
      

  6.   

    用window.showModalDialog不管是IE6还是IE7都屏蔽不掉的
    在IE7下window.open就不能弹出窗口了
      

  7.   

    此方法ie6  ie7都可以弹出窗口且没有提示
    <html>
    <head>
    <script type="text/javascript">
    var wHeight = 768;
    var wWidth = 1024;
    var x = (window.screen.availWidth-wWidth)/2;
    var y = (window.screen.availHeight-wHeight)/2;
    parent.window.opener=null;
    parent.window.open("","_self");
    parent.window.close();function openWindow(){
    window.open("fbrole/main/loginframe/login.jsp","","top="+y+",left="+x+",height="+wHeight+",width="+wWidth+",toolbar=no,menubar=no,scrollbars=no,resizable=yes,location=no,status=no");}
    </script>
    </head>
    <body onunload="openWindow();">
    </body>
    <html>
    ie7需要设置一下弹出方式,是新选项卡弹出还是新的页面弹出
    但是地址栏没有办法屏蔽掉【除非修改注册表】