无边框窗口代码详解

2016-01-29 12:09 46 1 收藏

无边框窗口代码详解,无边框窗口代码详解

【 tulaoshi.com - Java 】

  /*代码思路
此代码会以fullscreen方式打开一个空白窗口,然后用window.resize改变其大小。
最后在以写入onload="location.replace='url'"的办法将网址改变。
打开的窗口会是一个带有FRAME的窗口,其中窗口顶端会有一个高22的框架网页。
此网页是用来操纵窗口移动及关闭。
*/

/*说明
代码分两个部分,但总共牵涉到5个HTML文件及4个图像文件
第一部分是用来打开窗口,放在哪个文件都无所谓。
第二部分是用来控制窗口的移动及关闭,必须放在指定的文件里。
在此代码里,5个html文件分别为:
1.html; 代码第一部分所在
load.html; 所打开的窗口,是一个框架网页
chromelesstit.html;代码第2部分所在
contacting.html;用来显示如'PAGE LOADING.."等临时信息的网页
main.html;真正的主网页
4个图像分别为
x_a.gif; active
x_d.gif; mouseDown
x_o.gif; mouseOver
以上三个文件分别代表关闭窗口图标的不同状态
none.gif; 用来遮盖chromelesstit.html
*/

/*使用方法
如果你想让一个文件,如1.html,中的某一个连接打开一个指像main.html的无边框窗口。
把代码第一部分放到该文件中。
然后将连接
<a herf="main.html"
改为
<a herf="#" onclick="doOpen()"
在该文件所在目录内
1.建立
chromelesstit.html;
contacting.html;
load.html;
等三个文件,其HTML代码见本文所附。(不要做任何修改)
2.建立
一个名为images的目录(注意大小写,与有则不用),将
http//lain.oso.com.cn/x_a.gif;
http//lain.oso.com.cn/x_d.gif;
http//lain.oso.com.cn/x_o.gif;
http//lain.oso.com.cn/none.gif;
这4个文件拷入改目录.
对于初学者,以上则足够了。如果想要更好的效果,自己改代码。
*/
<!--//代码第一部分。
function doOpen(){
theurl="main.html";
wname ="name";
w=750;
h=400;
/* 参数说明:
theurl="main.html"; 打开窗口的网址
wname ="name"; 打开窗口的name属性
w=750; 打开窗口的宽度
h=400; 打开窗口的高度
*/
open(theurl, wname, w, h);
};
function open(theURL, wname, W, H) {
var windowW = W;//确定网页的宽度
var windowH = H;//确定网页的高度
var windowX = Math.ceil( (window.screen.width - windowW) / 2 );
var windowY = Math.ceil( (window.screen.height - windowH) / 2 );//确定网页的坐标

if (navigator.appName == "Microsoft Internet Explorer" && parseInt(navigator.appVersion)=4) isie=true; else isie=false;
s = ",width="+W+",height="+H;
if (isie===false){//加入对Nescape系列浏览器的支持
splashWin = window.open( "main.html" , wname, "fullscreen=1,toolbar=0,location=0,directories=0,status=0,menubar=0,scrollbars=0,resizable=0"+s)
splashWin.resizeTo( Math.ceil( W )    , Math.ceil( H ) )
splashWin.moveTo ( Math.ceil( windowX ) , Math.ceil( windowY ) )
}else{
splashWin = window.open( "" , wname, "fullscreen=1,toolbar=0,location=0,directories=0,status=0,menubar=0,scrollbars=0,resizable=0"+s)
splashWin.resizeTo( Math.ceil( W )    , Math.ceil( H ) )
splashWin.moveTo ( Math.ceil( windowX ) , Math.ceil( windowY ) )
splashWin.document.open("text/html", "replace");
splashWin.document.write("<html<style type='text/css'n");
splashWin.document.write("body{border: 1px solid #000000; overflow: hidden; margin: 0pt;}");
splashWin.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);}");
splashWin.document.write("</stylen");
splashWin.document.write("<body onload="top.document.location.replace('load.html")" TOPMARGIN=0 LEFTMARGIN=0 MARGINWIDTH=0 MARGINHEIGHT=0 scroll='no'");
splashWin.document.write("<div id=stillloadingDiv<table width=100% height=22 cellspacing=0 cellpadding=0<tr<td align=left valign=middle width=100%<FONT size=1 face=verdana color=#000

来源:https://www.tulaoshi.com/n/20160129/1484862.html

延伸阅读
    1.弹启一个全屏窗口 <html> <body onload="window.open(' http://www.e3i5.com','example01','fullscreen');"> <b>www.e3i5.com</b> </body> </html>     2.弹启一个被F11化后的窗口 <html> <body onload="window.open(' http://www.e3i5.com','example02','channelm...
标签: Web开发
$("#父窗口元素ID",window.parent.document)...就行了 js 版本 view sourceprint?1.window.parent.document.getElementById()
标签: 电脑入门
第一款:爱情轨迹 代码: javascript:window.top.space_addItem(16,21905,0,80,500,500,0); 第二宽:偏偏喜欢你 代码: javascript:window.top.space_addItem(16,21908,0,80,500,500,0); 第三款:爱的甜蜜蜜 代码: javascript:window.top.space_addItem(16,21903,0,80,500,500,0); 第四款:爱情之旅 代码: javascript:window.top.spac...
无边的璀璨 详解星空拍摄及后期技巧   当我为本次拍摄做准备的时候,阿西尼玻山早就在我的计划列表之内了。这是我见过的最美的山峰之一。但是,为这样的景色拍摄一幅与众不同的照片并不容易,不仅是其他很多摄影师在此地拍摄过很多优秀的作品,而且这里的地形状况也比较复杂。所以,拍摄一张与众不同的照片便成了我的首要目标。我从阿...
标签: Delphi
  unit Unit1;             interface             uses               Windows  Messages  SysUtils  Classes  Graphics&...

经验教程

104

收藏

53
微博分享 QQ分享 QQ空间 手机页面 收藏网站 回到头部