实现HMTL网页的全屏幕显示或模态显示

时间:2021-06-14 16:24:45

将下面的JS保存为:mail_fullscreen.js文件

实现HMTL网页的全屏幕显示或模态显示
实现HMTL网页的全屏幕显示或模态显示
实现HMTL网页的全屏幕显示或模态显示
// 简化版本的函数,只适合于IE5.0,Windows XP以上环境
实现HMTL网页的全屏幕显示或模态显示
function  modelScreen(strURI,X,Y,width,height){
实现HMTL网页的全屏幕显示或模态显示    fullWindow 
=  window.open(strURI , " full " , " width= "   +  (width)  +   " ,height= "   +  (height + 1 +   " ,toolbar=0,location=0,directories=0,status=0,menubar=0,scrollbars=0,resizable=0 " );            
实现HMTL网页的全屏幕显示或模态显示    fullWindow.moveTo(X,Y);
实现HMTL网页的全屏幕显示或模态显示    fullWindow.focus();
实现HMTL网页的全屏幕显示或模态显示}
实现HMTL网页的全屏幕显示或模态显示
实现HMTL网页的全屏幕显示或模态显示
/*
实现HMTL网页的全屏幕显示或模态显示下面的函数适合于所有主流浏览器和操作系统
实现HMTL网页的全屏幕显示或模态显示
实现HMTL网页的全屏幕显示或模态显示参数说明:
实现HMTL网页的全屏幕显示或模态显示windowWith :窗口宽度
实现HMTL网页的全屏幕显示或模态显示windowHeight:窗口高度
实现HMTL网页的全屏幕显示或模态显示windowX:     窗口起点X
实现HMTL网页的全屏幕显示或模态显示windowY:     窗口起点Y
实现HMTL网页的全屏幕显示或模态显示
*/
实现HMTL网页的全屏幕显示或模态显示
实现HMTL网页的全屏幕显示或模态显示
function  gfFullScreen(strURI){
实现HMTL网页的全屏幕显示或模态显示    
var  strAppVer  =  navigator.appVersion;
实现HMTL网页的全屏幕显示或模态显示    
var  strAppNM   =  navigator.appName;
实现HMTL网页的全屏幕显示或模态显示    
var  intPos     =  strAppVer.indexOf( " MSIE " , 0 );
实现HMTL网页的全屏幕显示或模态显示    
实现HMTL网页的全屏幕显示或模态显示    
var  windowWith = screen.availWidth / 2 ;
实现HMTL网页的全屏幕显示或模态显示    
var  windowHeight = screen.availHeight / 2 ;
实现HMTL网页的全屏幕显示或模态显示    
var  windowX = 20 ;
实现HMTL网页的全屏幕显示或模态显示    
var  windowY = 20
实现HMTL网页的全屏幕显示或模态显示
实现HMTL网页的全屏幕显示或模态显示    
if (strAppVer.indexOf( " Win " ) >= 0 ){  // OS--Windows
实现HMTL网页的全屏幕显示或模态显示
         if (strAppNM.indexOf( " Microsoft " ) >= 0 ){  // Browser--InternetExplorer
实现HMTL网页的全屏幕显示或模态显示
             if  (strAppNM  ==   " Microsoft Internet Explorer "   &&  parseInt(strAppVer) >= 4 ){  // IEversion more 4
实现HMTL网页的全屏幕显示或模态显示
                 if (parseInt(strAppVer.slice(intPos + 5 ,intPos + 6 )) >= 6 ){
实现HMTL网页的全屏幕显示或模态显示                    
if (parseInt(strAppVer.indexOf( " Windows NT 5.1 " , 0 ))  >   0 ){  // WindowsXP
实现HMTL网页的全屏幕显示或模态显示
                        fullWindow  =  window.open(strURI , " full " , " width= "   +  (windowWith)  +   " ,height= "   +  (windowHeight + 1 +   " ,toolbar=0,location=0,directories=0,status=0,menubar=0,scrollbars=0,resizable=0 " );
实现HMTL网页的全屏幕显示或模态显示                        
// fullWindow.moveTo(-5,-32);//全屏时的参数
实现HMTL网页的全屏幕显示或模态显示
                        fullWindow.moveTo(windowX,windowY);
实现HMTL网页的全屏幕显示或模态显示                        
实现HMTL网页的全屏幕显示或模态显示                    
//     window.location.HREF="/sgsoft";
实现HMTL网页的全屏幕显示或模态显示
                        fullWindow.focus();
实现HMTL网页的全屏幕显示或模态显示                    }
else // Not WindowsXP
实现HMTL网页的全屏幕显示或模态显示
                        fullWindow  =  window.open(strURI , " full " , " width= "   +  (windowWith)  +   " ,height= "   +  (windowHeight + 1 +   " ,toolbar=0,location=0,directories=0,status=0,menubar=0,scrollbars=0,resizable=0 " );
实现HMTL网页的全屏幕显示或模态显示                        
// fullWindow.moveTo(-5,-24);//全屏时的参数
实现HMTL网页的全屏幕显示或模态显示
                        fullWindow.moveTo(windowX,windowY);                        
实现HMTL网页的全屏幕显示或模态显示                        
// window.location.HREF="/sgsoft";
实现HMTL网页的全屏幕显示或模态显示
                        fullWindow.focus();
实现HMTL网页的全屏幕显示或模态显示                    }
实现HMTL网页的全屏幕显示或模态显示                }
else {
实现HMTL网页的全屏幕显示或模态显示                    fullWindow 
=  window.open( ""  , " full " , " fullscreen=1,width= "   +  (windowWith + 3 +   " ,height= "   +  (windowHeight + 1 +   " ,toolbar=0,location=0,directories=0,status=0,menubar=0,scrollbars=0,resizable=0 " );
实现HMTL网页的全屏幕显示或模态显示                    
// fullWindow.resizeTo(Math.ceil(windowWith+3),Math.ceil(windowHeight+1));
实现HMTL网页的全屏幕显示或模态显示
                    fullWindow.resizeTo(Math.ceil(windowWith + 3 ),Math.ceil(windowHeight + 1 ));
实现HMTL网页的全屏幕显示或模态显示                    
// fullWindow.moveTo(0,0);//全屏时的参数
实现HMTL网页的全屏幕显示或模态显示
                    fullWindow.moveTo(windowX,windowY);
实现HMTL网页的全屏幕显示或模态显示                    
实现HMTL网页的全屏幕显示或模态显示                    fullWindow.document.open(
" text/html " " replace " );
实现HMTL网页的全屏幕显示或模态显示                    fullWindow.document.write(
" <html><style type='text/css'>/n " );
实现HMTL网页的全屏幕显示或模态显示                    fullWindow.document.write(
" body{ border: 1px solid #000000; overflow: hidden; margin: 0pt;} " );
实现HMTL网页的全屏幕显示或模态显示                    fullWindow.document.write(
" #stillloadingDiv{ position: absolute; left: 0px; top: 0px; width: 100%px; height: 19px; z-index: 1; background-color: #C0C0C0; layer-background-color: #C0C0C0; clip:rect(0,100%,19,0);} " );
实现HMTL网页的全屏幕显示或模态显示                    fullWindow.document.write(
" </style>/n " );
实现HMTL网页的全屏幕显示或模态显示                    fullWindow.document.write(
" <body onload=/ " top.document.location.replace(' " +strURI+ " ')/ "  topmargin=0 leftmargin=0 marginwidth=0 marginheight=0 scroll='no'> " );
实现HMTL网页的全屏幕显示或模态显示                    fullWindow.document.write(
" <div ID='stillloadingDiv'></div> " );
实现HMTL网页的全屏幕显示或模态显示                    fullWindow.document.write(
" </body></html> " );
实现HMTL网页的全屏幕显示或模态显示                    fullWindow.document.close();
实现HMTL网页的全屏幕显示或模态显示                    
// window.location.HREF="/sgsoft";
实现HMTL网页的全屏幕显示或模态显示
                    fullWindow.focus();
实现HMTL网页的全屏幕显示或模态显示                }
实现HMTL网页的全屏幕显示或模态显示            }
else // IEversion under 4
实现HMTL网页的全屏幕显示或模态显示
                fullWindow  =  window.open(strURI, " full " , " width= "   +  (windowWith + 1 +   " ,height= "   +  (windowHeight - 21 +   " ,toolbar=0,location=0,directories=0,status=0,menubar=0,scrollbars=0,resizable=1,left=0,top=0,screenX=0,screenY=0 " , true );
实现HMTL网页的全屏幕显示或模态显示                
// window.location.HREF="/sgsoft";
实现HMTL网页的全屏幕显示或模态显示
            }
实现HMTL网页的全屏幕显示或模态显示        }
else   if (strAppNM.indexOf( " Netscape " ) >= 0 ){  // Browser--NetscapeNavigator
实现HMTL网页的全屏幕显示或模态显示
             // fullWindow = window.open("","full","scrollbars=0,resizable=0,width=" + (windowWith-12) +",height=" + (windowHeight-30));
实现HMTL网页的全屏幕显示或模态显示
            fullWindow  =  window.open( "" , " full " , " scrollbars=0,resizable=0,outerWidth= "   +  windowWith  + " ,outerheight= "   +  windowHeight  + " ,top=0,left=0 " );
实现HMTL网页的全屏幕显示或模态显示            fullWindow.moveBy(
0 , - 10 );
实现HMTL网页的全屏幕显示或模态显示            fullWindow.location.href 
=  strURI;
实现HMTL网页的全屏幕显示或模态显示            
// window.location.HREF="/sgsoft";
实现HMTL网页的全屏幕显示或模态显示
        } else // Browser-- 3rdParty
实现HMTL网页的全屏幕显示或模态显示
            location.replace( " alert.html " );
实现HMTL网页的全屏幕显示或模态显示            
// window.location.HREF="/sgsoft";
实现HMTL网页的全屏幕显示或模态显示
        }
实现HMTL网页的全屏幕显示或模态显示    }
else   if (strAppVer.indexOf( " Mac " ) >= 0 ){  // OS-Machintosh
实现HMTL网页的全屏幕显示或模态显示
         if (strAppVer.indexOf( " Safari " ) >= 0 ){  // Brower--Safari
实现HMTL网页的全屏幕显示或模态显示
            fullWindow = window.open( "" , " full " , " scrollbars=0,resizable=0,width= "   +  (windowWith)  + " ,height= "   +  (windowHeight - 20 ));
实现HMTL网页的全屏幕显示或模态显示            
// fullWindow.moveTo(0,0);//全屏时的参数
实现HMTL网页的全屏幕显示或模态显示
            fullWindow.moveTo(windowX,windowY);
实现HMTL网页的全屏幕显示或模态显示            
实现HMTL网页的全屏幕显示或模态显示            fullWindow.location.href
= strURI;
实现HMTL网页的全屏幕显示或模态显示            
// window.location.HREF="/sgsoft";
实现HMTL网页的全屏幕显示或模态显示
        } else {
实现HMTL网页的全屏幕显示或模态显示            
if (strAppNM.indexOf( " Microsoft " ) >= 0 ){  // Browser--InternetExplorer
实现HMTL网页的全屏幕显示或模态显示
                fullWindow  =  window.open(strURI, " full " , " alwaysLowered=0,alwaysRaised=0,channelmode=0,dependent=1,directories=0,fullscreen=1,hotkeys=1,location=0,menubar=0,resizable=0,scrollbars=0,status=0,titlebar=0,toolbar=0,z-lock=0,screenX=0,screeny=0,left=0,top=0 " );
实现HMTL网页的全屏幕显示或模态显示                fullWindow.resizeTo(windowWith,windowHeight);
实现HMTL网页的全屏幕显示或模态显示                
// window.location.HREF="/sgsoft";
实现HMTL网页的全屏幕显示或模态显示
            } else   if (strAppNM.indexOf( " Netscape " ) >= 0 ){  // Browser--NetscapeNavigator
实现HMTL网页的全屏幕显示或模态显示
                fullWindow = window.open( "" , " full " , " scrollbars=0,resizable=0,width= "   +  (windowWith - 12 + " ,height= "   +  (windowHeight - 30 ));
实现HMTL网页的全屏幕显示或模态显示                
// fullWindow.moveTo(0,0);
实现HMTL网页的全屏幕显示或模态显示
                fullWindow.moveTo(windowX,windowY);
实现HMTL网页的全屏幕显示或模态显示                
实现HMTL网页的全屏幕显示或模态显示                fullWindow.location.href
= strURI;
实现HMTL网页的全屏幕显示或模态显示                
// window.location.HREF="/sgsoft";
实现HMTL网页的全屏幕显示或模态显示
            } else // Browser-- 3rdParty
实现HMTL网页的全屏幕显示或模态显示
                location.replace( " alert.html " );
实现HMTL网页的全屏幕显示或模态显示                
// window.location.HREF="/sgsoft";
实现HMTL网页的全屏幕显示或模态显示
            }
实现HMTL网页的全屏幕显示或模态显示        }
实现HMTL网页的全屏幕显示或模态显示    }
else {
实现HMTL网页的全屏幕显示或模态显示        location.replace(
" alert.html " );
实现HMTL网页的全屏幕显示或模态显示        
// window.location.HREF="/sgsoft";
实现HMTL网页的全屏幕显示或模态显示
    }
实现HMTL网页的全屏幕显示或模态显示}
实现HMTL网页的全屏幕显示或模态显示


 


在HTML网页中使用它:

 

实现HMTL网页的全屏幕显示或模态显示< html >
实现HMTL网页的全屏幕显示或模态显示    
< head >
实现HMTL网页的全屏幕显示或模态显示        
< title > LifeWithDVD </ title >
实现HMTL网页的全屏幕显示或模态显示        
< meta  http-equiv ="Content-Type"  content ="text/html; charset=Shift_JIS" >
实现HMTL网页的全屏幕显示或模态显示        
< script  type ="text/javascript"  src ="mail_fullscreen.js" ></ script >
实现HMTL网页的全屏幕显示或模态显示    
</ head >
实现HMTL网页的全屏幕显示或模态显示    
< body  bgcolor ="#ffffff"  leftmargin ="0"  topmargin ="0"  marginwidth ="0"  marginheight ="0"
实现HMTL网页的全屏幕显示或模态显示        text
="#ffffff"  link ="#ffffff"  vlink ="#ffffff"  alink ="#ffffff" >
实现HMTL网页的全屏幕显示或模态显示        
< table  width ="100%"  border ="0"  cellspacing ="0"  cellpadding ="0"  height ="90%" >
实现HMTL网页的全屏幕显示或模态显示            
< tr  align ="center"  valign ="middle" >
实现HMTL网页的全屏幕显示或模态显示                
< td  height ="579"  colspan ="2" >< br >
实现HMTL网页的全屏幕显示或模态显示                    
< br >
实现HMTL网页的全屏幕显示或模态显示                    
< br >
实现HMTL网页的全屏幕显示或模态显示                    
< table  width ="135"  height ="135"  border ="0"  align ="center"  cellpadding ="0"  cellspacing ="0" >
实现HMTL网页的全屏幕显示或模态显示                        
< tr >
实现HMTL网页的全屏幕显示或模态显示                            
< td  width ="135"  height ="135"  colspan ="2"  align ="center"  valign ="top" >
实现HMTL网页的全屏幕显示或模态显示                                
< table  width ="135"  height ="135"  border ="0"  align ="center"  cellpadding ="0"  cellspacing ="0" >
实现HMTL网页的全屏幕显示或模态显示                                    
< tr >
实现HMTL网页的全屏幕显示或模态显示                                        
< td  height ="135" >< href ="javascript:modelScreen('content/main.html',20,20,800,600);" >< img  src ="./image/sun.jpg"  width ="827"  height ="297"  border ="0" ></ a ></ td >
实现HMTL网页的全屏幕显示或模态显示                                    
</ tr >
实现HMTL网页的全屏幕显示或模态显示                                
</ table >
实现HMTL网页的全屏幕显示或模态显示                            
</ td >
实现HMTL网页的全屏幕显示或模态显示                        
</ tr >
实现HMTL网页的全屏幕显示或模态显示                    
</ table >
实现HMTL网页的全屏幕显示或模态显示                
</ td >
实现HMTL网页的全屏幕显示或模态显示            
</ tr >
实现HMTL网页的全屏幕显示或模态显示        
</ table >
实现HMTL网页的全屏幕显示或模态显示    
</ body >
实现HMTL网页的全屏幕显示或模态显示
</ html >
实现HMTL网页的全屏幕显示或模态显示