通常打开网页用window.open,这种方式打开的网页太不美观,求一个漂亮实用的网页弹窗控件,可以自定义窗口的width、height和标题。

解决方案 »

  1.   


    function OpenWindow(strFile,strTitle,theWidth,theHeight){//开窗
     window.open(strFile,strTitle,"scrollbars=yes,toolbar=no,menubar=no,location=no,left=0,top=0,height="+theHeight+",width="+theWidth+",resizable=no");
    }
      

  2.   

     推荐下载:http://download.csdn.net/source/1392587
     应该可以满足LZ你的要求 我也在用这个 
     里面的参数可以自己内定
     而且图片那些都可以自己修改...
      

  3.   


    var W = screen.width;//取得屏幕分辨率宽度
    var H = screen.height;//取得屏幕分辨率高度function M(id){
    return document.getElementById(id);//用M()方法代替document.getElementById(id)
    }
    function MC(t){
    return document.createElement(t);//用MC()方法代替document.createElement(t)
    };
    //判断浏览器是否为IE
    function isIE(){
       return (document.all && window.ActiveXObject && !window.opera) ? true : false;

    //取得页面的高宽
    function getBodySize(){
       var bodySize = [];
       var div_leftContainer = M("leftContainer");
       var div_rightContainer = M("rightContainer");
        bodySize[0] = document.documentElement.clientWidth-20;//页面宽度
       if(div_leftContainer.clientHeight>div_rightContainer.clientHeight)
       {
            bodySize[1]=div_leftContainer.clientHeight+50;
    //    alert("clientHeight"+document.documentElement.clientHeight+"scrollTop"+document.documentElement.scrollTop);
       }
       else
       {
            bodySize[1]=div_rightContainer.clientHeight+50;
       }
        return bodySize;
    }
    //创建遮盖层
    function popCoverDiv(){
    if (M("cover_div")) {
    //如果存在遮盖层,则让其显示 
    M("cover_div").style.display = 'block';
    } else {
    //否则创建遮盖层
    var coverDiv = MC('div');
    document.body.appendChild(coverDiv);
    coverDiv.id = 'cover_div';
    with(coverDiv.style) {
        position = 'absolute';
        background = '#444444';
        left = '0px';
        top = '0px';
        var bodySize = getBodySize();
        width = bodySize[0] + 'px'
        height = bodySize[1] + 'px';
        zIndex = 0;
        if (isIE()) {
       filter = "Alpha(Opacity=60)";//IE逆境
        } else {
       opacity = 0.6;
        }
    }
    }
    }function showloginerror()
    {
        var div_title = M("divLogTitle");
        div_title.style.display = "block";
    }
    //让要显示的页面显示为块 
    function showPage()
    {
        var div_mainpop=M("div_mainpop");
        div_mainpop.style.display = "block";
    }//设置DIV层的样式
    function change(){
       var div_mainpop = M("div_mainpop");
       div_mainpop.style.position = "absolute";
       div_mainpop.style.border = "1px solid #CCCCCC";
       var i=0;
    //   var div_leftContainer = M("leftContainer");
    //   var div_rightContainer = M("rightContainer");
        var loginwight;
        var loginheight;//页面可视高度
           loginwight=document.documentElement.clientWidth;
           loginheight=document.documentElement.clientHeight;    
       popChange(i,loginwight,loginheight);
    }
    //让DIV层大小循环增大
    function popChange(i,loginwight,loginheight){
       var div_mainpop = M("div_mainpop");
       div_mainpop.style.left = (loginwight-i*i*2)/2+"px";
       div_mainpop.style.top = (loginheight/2-i*i*0.75+document.documentElement.scrollTop)+"px";
       div_mainpop.style.width =    i*i*2 + "px";
       div_mainpop.style.height = i*i*1.5+ "px";
       if(i<=10){
              i++;
              setTimeout("popChange("+i+","+loginwight+","+loginheight+")",10);//设置超时10毫秒
       }
    }//打开DIV层
    function openset(obj)
    {
        change();
        showLogin();
        var module = Element.getAncesstorByClassName(obj, "module");
        var moduleid = document.getElementsByClassName("hidden", module)[0];
        M('moduleid').value=moduleid.value;
        var titile = document.getElementsByClassName("link", module)[0];
        M('lb_poptop').innerText=titile.title;
        M('listCount').value='';    popCoverDiv()
        void(0);//不进行任何操作,如:<a href="#">aaa</a>
    }
    //关闭DIV层
    function closepop(){
        M('div_mainpop').style.display = 'none';
        M("cover_div").style.display = 'none';
    void(0);
    }<div id="div_main_panel">
    要显示的页面内容
    </div>
      

  4.   

    lhgdialog打开不了.aspx动态页面
      

  5.   

    http://blog.csdn.net/xianfajushi/archive/2009/08/24/4480302.aspx换做法看
      

  6.   

    下载一个greybox
           把js导入到项目中 <script type="text/javascript" src="greybox/AJS.js"></script>
            <script type="text/javascript" src="greybox/AJS_fx.js"></script>
            <script type="text/javascript" src="greybox/gb_scripts.js"></script>
             <script type="text/javascript" src="static_files/help.js"></script>
    后台调用 LinkButton1.Attributes.Add("onclick", "return GB_showCenter('修改密码', '../Default6.aspx?Id=" + id + "&page=" + CurPageIndex.ToString() + "',400,420)");