精彩的頁面窗口代碼大收集! ==根据你的要求打开窗口== 把如下代码加入<body></body>之間 <SCRIPT LANGUAGE="javascript"> <!-- Begin var U = "輸入要聯接的頁面地址"; var X = 100; // x position var Y = 100; // y position var W = 200; // width var H = 200; // height // Do not edit below this line. var s="resizable,left="+X+",top="+Y+",screenX="+X+",screenY="+Y+",width="+W+",height="+H; function popMe(){ var SGW = window.open(U,'TheWindow',s) } // End --> </script> <a href="javascript:popMe()">打开窗口</a> --------------------------------------------------------------------------------- ===设定IE的大小来适合主页=== 把如下代码加入<body></body>之間 1。设定IE的大小、位置来适合你的主页 <script language="javascript"> self.resizeTo(800,600) self.moveTo(0,0) </script> 2。设定IE的大小、位置来适合整个屏幕 <script language="javascript"> self.resizeTo(screen.width,screen.height) self.moveTo(0,0) </script> --------------------------------------------------------------------------------- ==展开式的弹出窗口== 注:可让你的弹出窗口活跃起来,从左至右的展开。 将下面的代码复制到<head>~</head>里 <script language=javascript> function expandingWindow(website) { var heightspeed = 2; // vertical scrolling speed (higher = slower) var widthspeed = 7; // horizontal scrolling speed (higher = slower) var leftdist = 0; // distance to left edge of window var topdist = 0; // distance to top edge of window var winwidth = window.screen.availWidth - leftdist; var winheight = window.screen.availHeight - topdist; var sizer = window.open("","","left=" + leftdist + ",top=" + topdist + ",width=200,height=500,scrollbars=yes"); for (sizeheight = 1; sizeheight < winheight; sizeheight += heightspeed) { sizer.resizeTo("1", sizeheight); } for (sizewidth = 1; sizewidth < winwidth; sizewidth += widthspeed) { sizer.resizeTo(sizewidth, sizeheight); } sizer.location = website; } </script> 将下面的代码复制到<body>~</body>里 <a href="javascript:expandingWindow('/html/')">HTML特效</a> 设置弹出窗口的大小: var winwidth = 200; //200为弹出窗口的宽度 var winheight = 500; //500为弹出窗口的高度 --------------------------------------------------------------------------------- == 花俏的转动的窗口 == 将下面的代码复制到<head>~</head>里 <script> window.scrollBy(0, 100) window.resizeTo(0,0) window.moveTo(0,0) document.bgColor=0xFFFFFF document.fgColor=0xFFFFFF //setInterval("move()",30); setTimeout("move()", 1); var mxm=50 var mym=25 var mx=0 var my=0 var sv=50 var status=1 var szx=0 var szy=0 var c=255 var n=0 var sm=30 var cycle=2 var done=2 function move() { if (status == 1) { mxm=mxm/1.05 mym=mym/1.05 mx=mx+mxm my=my-mym mxm=mxm+(400-mx)/100 mym=mym-(300-my)/100 window.moveTo(mx,my) rmxm=Math.round(mxm/10) rmym=Math.round(mym/10) if (rmxm == 0) { if (rmym == 0) { status=2 } } } if (status == 2) { sv=sv/1.1 scrratio=1+1/3 mx=mx-sv*scrratio/2 my=my-sv/2 szx=szx+sv*scrratio szy=szy+sv window.moveTo(mx,my) window.resizeTo(szx,szy) if (sv < 0.1) { status=3 } } if (status == 3) { document.fgColor=0xffffFF c=c-16 document.bgColor=0xffffFF if (c<0) {status=8} } if (status == 4) { c=c+16 document.bgColor=c*65536 document.fgColor=(255-c)*65536 if (c > 239) {status=5} } if (status == 5) { c=c-16 document.bgColor=c*65536 document.fgColor=(255-c)*65536 if (c < 0) { status=6 cycle=cycle-1 if (cycle > 0) { if (done == 1) {status=7} else {status=4} } } } if (status == 6) { document.title = "" alert("") cycle=2 status=4 done=1 } if (status == 7) { c=c+4 document.bgColor=c*65536 document.fgColor=(255-c)*65536 if (c > 128) {status=8} } if (status == 8) { window.moveTo(0,0) sx=screen.availWidth sy=screen.availHeight window.resizeTo(sx,sy) status=9 } var timer=setTimeout("move()",0.3) } </script> 注:修改背景色: 在javascript的第5-6行: document.bgColor=0xFFFFFF document.fgColor=0xFFFFFF --------------------------------------------------------------------------------- ==页面开场白== 将下面的代码复制到<body>~</body>里 <meta http-equiv=Page-Enter content=revealTrans(Transition=23,Duration=1.000)> 注:22种不同的效果: <meta http-equiv=Page-Enter content=revealTrans(Transition=1,Duration=1.000)> // 内向外方形 <meta http-equiv=Page-Enter content=revealTrans(Transition=2,Duration=1.000)> // 外向内圆形 <meta http-equiv=Page-Enter content=revealTrans(Transition=3,Duration=1.000)> // 内向外圆形 <meta http-equiv=Page-Enter content=revealTrans(Transition=4,Duration=1.000)> // 下至上推升 <meta http-equiv=Page-Enter content=revealTrans(Transition=5,Duration=1.000)> // 上至下推升 <meta http-equiv=Page-Enter content=revealTrans(Transition=6,Duration=1.000)> // 左至右拉屏 <meta http-equiv=Page-Enter content=revealTrans(Transition=7,Duration=1.000)> // 左至右拉屏 <meta http-equiv=Page-Enter content=revealTrans(Transition=8,Duration=1.000)> // 左至右半百叶窗 <meta http-equiv=Page-Enter content=revealTrans(Transition=9,Duration=1.000)> // 上至下半百叶窗 <meta http-equiv=Page-Enter content=revealTrans(Transition=10,Duration=1.000)> // 左至右百叶窗 <meta http-equiv=Page-Enter content=revealTrans(Transition=11,Duration=1.000)> // 上至下百叶窗 <meta http-equiv=Page-Enter content=revealTrans(Transition=12,Duration=1.000)> // 麻点显示 <meta http-equiv=Page-Enter content=revealTrans(Transition=13,Duration=1.000)> // 由外向内开场 <meta http-equiv=Page-Enter content=revealTrans(Transition=14,Duration=1.000)> // 由内向外开场 <meta http-equiv=Page-Enter content=revealTrans(Transition=15,Duration=1.000)> // 由上下向里开场 <meta http-equiv=Page-Enter content=revealTrans(Transition=16,Duration=1.000)> // 由里向上下开场 <meta http-equiv=Page-Enter content=revealTrans(Transition=17,Duration=1.000)> // 由右上向左下 <meta http-equiv=Page-Enter content=revealTrans(Transition=18,Duration=1.000)> // 由右下向左上 <meta http-equiv=Page-Enter content=revealTrans(Transition=19,Duration=1.000)> // 由左上向右下 <meta http-equiv=Page-Enter content=revealTrans(Transition=20,Duration=1.000)> // 由左下向右上 <meta http-equiv=Page-Enter content=revealTrans(Transition=21,Duration=1.000)> // 横向线条显示 <meta http-equiv=Page-Enter content=revealTrans(Transition=22,Duration=1.000)> // 纵向线条显示 <meta http-equiv=Page-Enter content=revealTrans(Transition=23,Duration=1.000)> // 随机
|