全屏:
window.open("WebForm3.aspx",'','resizable=1,scrollbars=1,fullscreen=1')

解决方案 »

  1.   

    你给BODY加上样式 overflow:hidden
     就可以隐藏滚动条了.
      

  2.   

    <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
    <html xmlns="http://www.w3.org/1999/xhtml">
    <head>
    <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
    <title>Flash全屏功能测试</title>
    <style type="text/css">
    <!--
    body,td,th {
    font-family: Courier New, Courier, monospace;
    }
    body {
    margin-left: 0px;
    margin-top: 0px;
    margin-right: 0px;
    margin-bottom: 0px;
    }
    -->
    </style>
    </head>
    <body>
    <div id="flashcontent" style="width:400px;height:300px;"></div>
    <script language="javascript" src="js/swfobject.js"></script>
    <script language="JavaScript">
    var orginFlash = {init:false,isFullScreen:false,position:"",top:"",left:"",width:"",height:""};
    function writeFlash(){
    var so = new SWFObject("fullscreen.swf", "fplayer", "100%", "100%", 8, "#FFFFFF");
    so.addParam("quality", "high");
    so.addParam("swLiveConnect", "true");
    so.addParam("menu", "false");
    so.addParam("allowScriptAccess", "sameDomain");
    so.addParam("allowFullScreen", "true");
    so.write("flashcontent");
    }
    function getScreenSize(){
    var w = 0;
    var h = 0;
    if( typeof( window.innerWidth ) == 'number' ) {
    w = window.innerWidth;
    h = window.innerHeight;
    } else if( document.documentElement && ( document.documentElement.clientWidth || document.documentElement.clientHeight ) ) {
    w = document.documentElement.clientWidth;
    h = document.documentElement.clientHeight;
    } else if( document.body && ( document.body.clientWidth || document.body.clientHeight ) ) {
    w = document.body.clientWidth;
    h = document.body.clientHeight;
    }
    return {width:w,height:h};
    }
    function fullScreen(){
    if(!orginFlash.init){
    orginFlash.position = document.getElementById("flashcontent").style.position;
    orginFlash.top = document.getElementById("flashcontent").style.top;
    orginFlash.left = document.getElementById("flashcontent").style.left;
    orginFlash.width = document.getElementById("flashcontent").style.width;
    orginFlash.height = document.getElementById("flashcontent").style.height;
    }
    orginFlash.init = true;
    orginFlash.isFullScreen = true;
    var screenSize = getScreenSize();
    try{
    document.getElementById("flashcontent").style.position = "absolute";
    document.getElementById("flashcontent").style.top = "0px";
    document.getElementById("flashcontent").style.left = "0px";
    document.getElementById("flashcontent").style.width = screenSize.width +"px";
    document.getElementById("flashcontent").style.height = screenSize.height +"px";
    document.body.style.overflow="hidden";
    window.scrollTo(0,0);
    }catch(e){
    }
    }
    function normal(){
    if(orginFlash.init){
    orginFlash.isFullScreen = false;
    try{
    document.getElementById("flashcontent").style.position = orginFlash.position;
    document.getElementById("flashcontent").style.top = orginFlash.top;
    document.getElementById("flashcontent").style.left = orginFlash.left;
    document.getElementById("flashcontent").style.width = orginFlash.width;
    document.getElementById("flashcontent").style.height = orginFlash.height;
    document.body.style.overflow="auto";
    }catch(e){
    }
    }
    }
    function reSize(){
    if(orginFlash.isFullScreen){
    fullScreen();
    }
    }
    window.onresize = reSize;
    writeFlash();
    </script>
    </body>
    </html>做成FLASH
      

  3.   

    做成flash可能是唯一的解决方法
      

  4.   

    只能做成flash了吗,楼上的可用方法我都试过了,还是去不掉右边的滚动条,难道和ie版本有关系吗??
      

  5.   

    <script>
    function test(){
    window.open('c.htm','tese','fullscreen=yes');
    }
    </script>
    <body style="overflow:hidden;">
    <input type="button" onclick="test();" value="全屏">
    <pre>
    sdfsadfsadfsadf
    sdf
    a
    asdf
    as
    df
    sa
    d
    f
    asdf
    s
    adf
    sad
    f
    asdf
    sa
    f
    sa
    df
    s
    df
    sd
    f
    sadf asdf
    sa
    df
    sad
    f
    asf
    a
    df
    sad
    f
    sd
    fs
    d
    fs
    adf
    sa
    df
    sad
    f
    sa
    dfs
    adf
    s
    adf
    sad
    f
    sad
    f
    sad
    f
    sad
    f
    sad
    f
    sadf safd
    sa
    df
    sa
    df
    sad
    fs
    ad
    f
    sdf
    sad
    f
    sad
    f
    sadf
    saf
    </pre></body>
      

  6.   

    你把这段代码保存为c.htm 看看是不是你要的效果
      

  7.   

    楼上兄弟,谢谢了!但是
    http://www.51ganen.cn/test/c.htm 状态栏和标题栏还是去不掉,我浏览器6.0的。
      

  8.   

    我测试了下, 本地的html文件 这样做 的确是全屏,一但发布到web容器里面 就不行了. 会出现地址栏和状态栏
      

  9.   

    经本人再次测试,找到原因了.发布到web容器里面,浏览器默认是认为此地址为非安全的网站.
    所以禁止使用脚本初始化窗口.而你本地的html文件,浏览器认为此是安全的网站,所以js没有限制.
    所以问题出来了.你想使用js得到全屏效果.就必须手动修改你浏览器的设置
    (IE选项->安全->自定义选项->把"允许由脚本初始化的窗口,没有大小和位置的限制"设为启用)
      

  10.   

    问题已经解决,定义html,body{overflow:hidden;},然后用F11去实现就可以了。