JS打开各种模式窗口

用js可以实现
1、asp.net 怎样在本页去掉IE的 菜单栏,工具栏,导航栏??
答:window.open(url,"status:no;scroll:no;dialogWidth:520px;dialogHeight:300px")
2、//JAVASCRIPT实现===============================================================
//
//  代码描述:打开一个新的没有状态栏、工具栏、菜单栏、定位栏,
//            不能改变大小,且位置居中的新窗口
//  
//  传入参数:pageURL - 传递链接
//            innerWidth - 传递需要打开新窗口的宽度
//            innerHeight - 传递需要打开新窗口的高度
//  
//  返回参数:无
//
//
//==========================================================================
    private void openWindow(string mode)
    {
        string script = "<script type=\"text/javascript\">";
        script += @"var height = (screen.availHeight - 530)/2;";
        script += @"var width = (screen.availWidth - 600)/2;";

        script += @"var win = window.open('BC1002.aspx?mode=" + mode + @"','mode',

'height=520px,width=600px,status=yes,toolbar=no,menubar=no,location=no,top='+ height + ',left=' + width);

                    win.focus();</script>";
        ClientScript.RegisterClientScriptBlock(this.GetType(), "key", script);
    }
3、//==========================================================================
//
//  代码描述:打开一个新的有状态栏、工具栏、菜单栏、定位栏,
//            可以改变大小,且位置居中的新窗口
//  
//  传入参数:pageURL - 传递链接
//            innerWidth - 传递需要打开新窗口的宽度
//            innerHeight - 传递需要打开新窗口的高度
//  
//  返回参数:无
//
//
//==========================================================================
function g_OpenSizeWindow(pageURL, innerWidth, innerHeight)
{    
    var ScreenWidth = screen.availWidth
    var ScreenHeight = screen.availHeight
    var StartX = (ScreenWidth - innerWidth) / 2
    var StartY = (ScreenHeight - innerHeight) / 2

    window.open(pageURL, '', 'left='+ StartX + ', top='+ StartY + ', Width=' + innerWidth +', height=' + innerHeight + ',

resizable=yes, scrollbars=yes, status=yes, toolbar=yes, menubar=yes, location=no')


}
4、//==========================================================================
//
//  代码描述:打开一个新的没有状态栏、工具栏、菜单栏、定位栏,
//            不能改变大小,且位置居中的新窗口
//  
//  传入参数:pageURL - 传递链接
//            innerWidth - 传递需要打开新窗口的宽度
//            innerHeight - 传递需要打开新窗口的高度
//  
//  返回参数:无
//
//
//==========================================================================
function g_OpenWindow(pageURL, innerWidth, innerHeight)
{    
    var ScreenWidth = screen.availWidth
    var ScreenHeight = screen.availHeight
    var StartX = (ScreenWidth - innerWidth) / 2
    var StartY = (ScreenHeight - innerHeight) / 2

    window.open(pageURL, '', 'left='+ StartX + ', top='+ StartY + ', Width=' + innerWidth +', height=' + innerHeight + ',

resizable=no, scrollbars=yes, status=no, toolbar=no, menubar=no, location=no')

}

5、//==========================================================================
//
//  代码描述:打开一个新的没有状态栏、工具栏、菜单栏、定位栏,
//            不能改变大小,且位置居中的新窗口
//       
//  
//  传入参数:pageURL - 传递链接
//            innerWidth - 传递需要打开新窗口的宽度
//            innerHeight - 传递需要打开新窗口的高度
//  
//  返回参数:返回的数值
//
//
//==========================================================================
function g_OpenReturnWindow(pageURL, innerWidth, innerHeight)
{    
    var ScreenWidth = screen.availWidth
    var ScreenHeight = screen.availHeight
    var StartX = (ScreenWidth - innerWidth) / 2
    var StartY = (ScreenHeight - innerHeight) / 2

    window.open(pageURL, '', 'left='+ StartX + ', top='+ StartY + ', Width=' + innerWidth +', height=' + innerHeight + ',

resizable=no, scrollbars=yes, status=no, toolbar=no, menubar=no, location=no')

    return false
}

function g_OpenReturnWindowNoScrollbars(pageURL, innerWidth, innerHeight)
{    
    var ScreenWidth = screen.availWidth
    var ScreenHeight = screen.availHeight
    var StartX = (ScreenWidth - innerWidth) / 2
    var StartY = (ScreenHeight - innerHeight) / 2

    window.open(pageURL, '', 'left='+ StartX + ', top='+ StartY + ', Width=' + innerWidth +', height=' + innerHeight + ',

resizable=no, scrollbars=no, status=no, toolbar=no, menubar=no, location=no')

    //return false
}


6、//==========================================================================
//
//  代码描述:打开一个新的没有状态栏、工具栏、菜单栏、定位栏,
//            不能改变大小,且位置居中的新窗口
//  
//  传入参数:pageURL - 传递链接
//  
//  返回参数:无
//
//
//==========================================================================
function g_OpenReturnWindowPrint(pageURL)
{    
    var ScreenWidth = screen.availWidth
    var ScreenHeight = screen.availHeight
    //var StartX = (ScreenWidth - innerWidth) / 2
    //var StartY = (ScreenHeight - innerHeight) / 2

    var Win = window.open(pageURL, '','Width=' + ScreenWidth +', height=' + ScreenHeight + ',

 resizable=no, scrollbars=no, status=no, toolbar=no, menubar=no, location=no, left=0, top=0')

    Win.moveTo(99999,99999)    
    return false
}
7、//==========================================================================================
//
// 代码描述:打开模式窗口函数,打开一个模式窗口不包含菜单、状态条、工具条、定位栏
//
// 传入参数:pageURL - 传递链接
//            innerWidth - 传递需要打开新窗口的宽度
//            innerHeight - 传递需要打开新窗口的高度
// 返回参数:无
//
//
//==========================================================================================
function g_OpenModalWindow(pageURL, innerWidth, innerHeight)
{

    window.showModalDialog(pageURL, null, 'dialogWidth:' + innerWidth + 'px;dialogHeight:' + innerHeight + 'px;

help:no;unadorned:no;resizable:no;status:no')

}

8、//==========================================================================================
//
// 代码描述:打开模式窗口函数,打开一个模式窗口不包含菜单、状态条、工具条、定位栏 ,并且返回值
//
// 传入参数:pageURL - 传递链接
//            innerWidth - 传递需要打开新窗口的宽度
//            innerHeight - 传递需要打开新窗口的高度
// 返回参数:模式窗体返回的returnValue
//
//
//==========================================================================================
function g_OpenreturnWindow(pageURL, innerWidth, innerHeight)
{
    var returnv;

    returnv=window.showModalDialog(pageURL, null, 'dialogWidth:' + innerWidth + 'px;dialogHeight:' + innerHeight + 'px;

help:no;unadorned:no;resizable:no;status:no')

    return returnv;
}

9、//==========================================================================================
//
// 代码描述:打开模式窗口函数,打开一个模式窗口不包含菜单、状态条、工具条、定位栏
//
// 传入参数:pageURL - 传递链接
//            innerWidth - 传递需要打开新窗口的宽度
//            innerHeight - 传递需要打开新窗口的高度
// 返回参数:无
//
//
//==========================================================================================
function g_OpenReturnModalWindow(pageURL, innerWidth, innerHeight)
{

    window.showModalDialog(pageURL, null, 'dialogWidth:' + innerWidth + 'px;dialogHeight:' + innerHeight + 'px;

help:no;unadorned:no;resizable:no;status:no');

    return false;
}


10、//==========================================================================================
//
// 代码描述:关闭窗口
//
// 传入参数:无
//
// 返回参数:无
//
//
//==========================================================================================
function g_CloseWindow()
{
    window.close()
    return false
}
  • 0
    点赞
  • 3
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值