Thu

05

Mar

2009

125、键盘改变窗口大小

125、键盘改变窗口大小

脚本说明:

把如下代码加入<body>区域中

<SCRIPT LANGUAGE="JavaScript">

<!-- Begin

function movepage()

{

var direction =event.keyCode

switch(direction){

case 39:

window.moveTo(0, 0);

window.resizeBy(10, 0);

window.resizeBy(0, 0);

break

case 37:

window.moveTo(0, 0);

window.resizeBy(-10, 0);

window.resizeBy(0, 0);

break

case 38:

window.moveTo(0, 0);

window.resizeBy(0, 0);

window.resizeBy(0, -10);

break

case 40:

window.moveTo(0, 0);

window.moveBy(0, 0);

window.resizeBy(0, 10);

break

default:

break

}

}

//  End -->

</script>

 

 

第二步:把<body>中的内容改为:

<BODY onLoad="top.window.focus()" onkeydown="movepage()">

 

0 Comments

Thu

05

Mar

2009

124、打开定制大小窗口???

124、打开定制大小窗口???

脚本说明:

把如下代码加入<body>区域中

<input id=h value=300><input id=w value=300>

<input type=button onclick=aa() value=打开窗口>

<script language='javascript'>

function aa(){

y=window.showModalDialog("http://www.k688.com","","dialogHeight:"+h.value+"px; dialogWidth: "+w.value+"px; help: no");

}

</script>

 

0 Comments

Thu

05

Mar

2009

123、页面内超级酷浮动窗口

123、页面内超级酷浮动窗口

脚本说明:

把如下代码加入<body>区域中

<input id=h value=300><input id=w value=300>

<input type=button onclick=aa() value=打开窗口>

<script language='javascript'>

function aa(){

y=window.showModalDialog("http://www.7stk.com","","dialogHeight:"+h.value+"px; dialogWidth: "+w.value+"px; help: no");

}

</script>

 

0 Comments

Thu

05

Mar

2009

122、窗口从上掉下来

122、窗口从上掉下来

脚本说明:

把如下代码加入<body>区域中

<script language="JavaScript1.2">

 

var ie=document.all

var dom=document.getElementById

var ns4=document.layers

 

var bouncelimit=32 //(must be divisible by 8)

var curtop

var direction="up"

var boxheight=''

 

function initbox(){

if (!dom&&!ie&&!ns4)

return

crossobj=(dom)?document.getElementById("dropin").style : ie? document.all.dropin : document.dropin

scroll_top=(ie)? document.body.scrollTop : window.pageYOffset

crossobj.top=scroll_top-250

crossobj.visibility=(dom||ie)? "visible" : "show"

dropstart=setInterval("dropin()",50)

}

 

function dropin(){

scroll_top=(ie)? document.body.scrollTop : window.pageYOffset

if (parseInt(crossobj.top)<100+scroll_top)

crossobj.top=parseInt(crossobj.top)+40

else{

clearInterval(dropstart)

bouncestart=setInterval("bouncein()",50)

}

}

 

function bouncein(){

crossobj.top=parseInt(crossobj.top)-bouncelimit

if (bouncelimit<0)

bouncelimit+=8

bouncelimit=bouncelimit*-1

if (bouncelimit==0){

clearInterval(bouncestart)

}

}

 

function dismissbox(){

if (window.bouncestart) clearInterval(bouncestart)

crossobj.visibility="hidden"

}

 

 

window.onload=initbox

 

</script>

<div id="dropin" style="position:absolute;visibility:hidden;left:250;top:100;width:500;height:300;background-color:#F5F5F5">

 

<div align="right"><a href="javascript:dismissbox()">[关闭窗口] </a></div>这是从上面掉下来的窗口,没吓着您吧,哈哈...

 

</div>

 

0 Comments

Thu

05

Mar

2009

121、旋转打开的窗口

121、旋转打开的窗口

脚本说明:

把如下代码加入<body>区域中

<SCRIPT>     

window.scrollBy(0, 100)     

window.resizeTo(0,0)     

window.moveTo(0,0)     

document.bgColor=0x000000     

document.fgColor=0x000000     

//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>

 

0 Comments

Thu

05

Mar

2009

120、透明的可移动层

120、透明的可移动层

脚本说明:

把如下代码加入<body>区域中

<SCRIPT language=JavaScript>

<!--

function MM_swapImgRestore() { //v3.0

  var i,x,a=document.MM_sr; for(i=0;a&&i<a.length&&(x=a[i])&&x.oSrc;i++) x.src=x.oSrc;

}

 

function MM_preloadImages() { //v3.0

  var d=document; if(d.images){ if(!d.MM_p) d.MM_p=new Array();

    var i,j=d.MM_p.length,a=MM_preloadImages.arguments; for(i=0; i<a.length; i++)

    if (a[i].indexOf("#")!=0){ d.MM_p[j]=new Image; d.MM_p[j++].src=a[i];}}

}

 

function MM_findObj(n, d) { //v4.0

  var p,i,x;  if(!d) d=document; if((p=n.indexOf("?"))>0&&parent.frames.length) {

    d=parent.frames[n.substring(p+1)].document; n=n.substring(0,p);}

  if(!(x=d[n])&&d.all) x=d.all[n]; for (i=0;!x&&i<d.forms.length;i++) x=d.forms[i][n];

  for(i=0;!x&&d.layers&&i<d.layers.length;i++) x=MM_findObj(n,d.layers[i].document);

  if(!x && document.getElementById) x=document.getElementById(n); return x;

}

 

function MM_swapImage() { //v3.0

  var i,j=0,x,a=MM_swapImage.arguments; document.MM_sr=new Array; for(i=0;i<(a.length-2);i+=3)

   if ((x=MM_findObj(a[i]))!=null){document.MM_sr[j++]=x; if(!x.oSrc) x.oSrc=x.src; x.src=a[i+2];}

}

//-->

</SCRIPT>

 

 

 

<SCRIPT language=JavaScript>

<!--

<!--

function MM_reloadPage(init) {  //reloads the window if Nav4 resized

  if (init==true) with (navigator) {if ((appName=="Netscape")&&(parseInt(appVersion)==4)) {

    document.MM_pgW=innerWidth; document.MM_pgH=innerHeight; onresize=MM_reloadPage; }}

  else if (innerWidth!=document.MM_pgW || innerHeight!=document.MM_pgH) location.reload();

}

MM_reloadPage(true);

// -->

 

function MM_dragLayer(objName,x,hL,hT,hW,hH,toFront,dropBack,cU,cD,cL,cR,targL,targT,tol,dropJS,et,dragJS) { //v3.0

  //Copyright 1998 Macromedia, Inc. All rights reserved.

  var i,j,aLayer,retVal,curDrag=null,NS=(navigator.appName=='Netscape'), curLeft, curTop;

  if (!document.all && !document.layers) return false;

  retVal = true; if(!NS && event) event.returnValue = true;

  if (MM_dragLayer.arguments.length > 1) {

    curDrag = MM_findObj(objName); if (!curDrag) return false;

    if (!document.allLayers) { document.allLayers = new Array();

      with (document) if (NS) { for (i=0; i<layers.length; i++) allLayers[i]=layers[i];

        for (i=0; i<allLayers.length; i++) if (allLayers[i].document && allLayers[i].document.layers)

          with (allLayers[i].document) for (j=0; j<layers.length; j++) allLayers[allLayers.length]=layers[j];

      } else for (i=0;i<all.length;i++) if (all[i].style&&all[i].style.position) allLayers[allLayers.length]=all[i];}

    curDrag.MM_dragOk=true; curDrag.MM_targL=targL; curDrag.MM_targT=targT;

    curDrag.MM_tol=Math.pow(tol,2); curDrag.MM_hLeft=hL; curDrag.MM_hTop=hT;

    curDrag.MM_hWidth=hW; curDrag.MM_hHeight=hH; curDrag.MM_toFront=toFront;

    curDrag.MM_dropBack=dropBack; curDrag.MM_dropJS=dropJS;

    curDrag.MM_everyTime=et; curDrag.MM_dragJS=dragJS;

    curDrag.MM_oldZ = (NS)?curDrag.zIndex:curDrag.style.zIndex;

    curLeft= (NS)?curDrag.left:curDrag.style.pixelLeft; curDrag.MM_startL = curLeft;

    curTop = (NS)?curDrag.top:curDrag.style.pixelTop; curDrag.MM_startT = curTop;

    curDrag.MM_bL=(cL<0)?null:curLeft-cL; curDrag.MM_bT=(cU<0)?null:curTop -cU;

    curDrag.MM_bR=(cR<0)?null:curLeft+cR; curDrag.MM_bB=(cD<0)?null:curTop +cD;

    curDrag.MM_LEFTRIGHT=0; curDrag.MM_UPDOWN=0; curDrag.MM_SNAPPED=false; //use in your JS!

    document.onmousedown = MM_dragLayer; document.onmouseup = MM_dragLayer;

    if (NS) document.captureEvents(Event.MOUSEDOWN|Event.MOUSEUP);

  } else {

    var theEvent = ((NS)?objName.type:event.type);

    if (theEvent == 'mousedown') {

      var mouseX = (NS)?objName.pageX : event.clientX + document.body.scrollLeft;

      var mouseY = (NS)?objName.pageY : event.clientY + document.body.scrollTop;

      var maxDragZ=null; document.MM_maxZ = 0;

      for (i=0; i<document.allLayers.length; i++) { aLayer = document.allLayers[i];

        var aLayerZ = (NS)?aLayer.zIndex:aLayer.style.zIndex;

        if (aLayerZ > document.MM_maxZ) document.MM_maxZ = aLayerZ;

        var isVisible = (((NS)?aLayer.visibility:aLayer.style.visibility).indexOf('hid') == -1);

        if (aLayer.MM_dragOk != null && isVisible) with (aLayer) {

          var parentL=0; var parentT=0;

          if (!NS) { parentLayer = aLayer.parentElement;

            while (parentLayer != null && parentLayer.style.position) {

              parentL += parentLayer.offsetLeft; parentT += parentLayer.offsetTop;

              parentLayer = parentLayer.parentElement; } }

          var tmpX=mouseX-(((NS)?pageX:style.pixelLeft+parentL)+MM_hLeft);

          var tmpY=mouseY-(((NS)?pageY:style.pixelTop +parentT)+MM_hTop);

          var tmpW = MM_hWidth;  if (tmpW <= 0) tmpW += ((NS)?clip.width :offsetWidth);

          var tmpH = MM_hHeight; if (tmpH <= 0) tmpH += ((NS)?clip.height:offsetHeight);

          if ((0 <= tmpX && tmpX < tmpW && 0 <= tmpY && tmpY < tmpH) && (maxDragZ == null

              || maxDragZ <= aLayerZ)) { curDrag = aLayer; maxDragZ = aLayerZ; } } }

      if (curDrag) {

        document.onmousemove = MM_dragLayer; if (NS) document.captureEvents(Event.MOUSEMOVE);

        curLeft = (NS)?curDrag.left:curDrag.style.pixelLeft;

        curTop = (NS)?curDrag.top:curDrag.style.pixelTop;

        MM_oldX = mouseX - curLeft; MM_oldY = mouseY - curTop;

        document.MM_curDrag = curDrag;  curDrag.MM_SNAPPED=false;

        if(curDrag.MM_toFront) {

          eval('curDrag.'+((NS)?'':'style.')+'zIndex=document.MM_maxZ+1');

          if (!curDrag.MM_dropBack) document.MM_maxZ++; }

        retVal = false; if(!NS) event.returnValue = false;

    } } else if (theEvent == 'mousemove') {

      if (document.MM_curDrag) with (document.MM_curDrag) {

        var mouseX = (NS)?objName.pageX : event.clientX + document.body.scrollLeft;

        var mouseY = (NS)?objName.pageY : event.clientY + document.body.scrollTop;

        newLeft = mouseX-MM_oldX; newTop  = mouseY-MM_oldY;

        if (MM_bL!=null) newLeft = Math.max(newLeft,MM_bL);

        if (MM_bR!=null) newLeft = Math.min(newLeft,MM_bR);

        if (MM_bT!=null) newTop  = Math.max(newTop ,MM_bT);

        if (MM_bB!=null) newTop  = Math.min(newTop ,MM_bB);

        MM_LEFTRIGHT = newLeft-MM_startL; MM_UPDOWN = newTop-MM_startT;

        if (NS) {left = newLeft; top = newTop;}

        else {style.pixelLeft = newLeft; style.pixelTop = newTop;}

        if (MM_dragJS) eval(MM_dragJS);

        retVal = false; if(!NS) event.returnValue = false;

    } } else if (theEvent == 'mouseup') {

      document.onmousemove = null;

      if (NS) document.releaseEvents(Event.MOUSEMOVE);

      if (NS) document.captureEvents(Event.MOUSEDOWN); //for mac NS

      if (document.MM_curDrag) with (document.MM_curDrag) {

        if (typeof MM_targL =='number' && typeof MM_targT == 'number' &&

            (Math.pow(MM_targL-((NS)?left:style.pixelLeft),2)+

             Math.pow(MM_targT-((NS)?top:style.pixelTop),2))<=MM_tol) {

          if (NS) {left = MM_targL; top = MM_targT;}

          else {style.pixelLeft = MM_targL; style.pixelTop = MM_targT;}

          MM_SNAPPED = true; MM_LEFTRIGHT = MM_startL-MM_targL; MM_UPDOWN = MM_startT-MM_targT; }

        if (MM_everyTime || MM_SNAPPED) eval(MM_dropJS);

        if(MM_dropBack) {if (NS) zIndex = MM_oldZ; else style.zIndex = MM_oldZ;}

        retVal = false; if(!NS) event.returnValue = false; }

      document.MM_curDrag = null;

    }

    if (NS) document.routeEvent(objName);

  } return retVal;

}

//-->

</SCRIPT>

 

<DIV id=Layer1

 

style="BORDER-RIGHT: #000000 1px; BORDER-TOP: #000000 1px; Z-INDEX: 1; LEFT: 546px;  BORDER-LEFT: #000000 1px; WIDTH: 112px; BORDER-BOTTOM: #000000 1px; POSITION: absolute; TOP: 182px; HEIGHT: 206px; layer-background-image: url(../images/index1/drag-bk.gif)"

 

onclick="MM_dragLayer('Layer1','',0,0,0,0,true,false,-1,-1,-1,-1,false,false,0,'',false,'')">

 

<TABLE class=f9 borderColor=#999999 height=200 cellSpacing=0 cellPadding=0

 

width=110 border=1>

 

  <TBODY>

 

  <TR>

 

    <TD vAlign=top height=5>

 

      <DIV align=center></DIV>

 

      <TABLE class=f9 cellSpacing=0 cellPadding=0 width=110 bgColor=#996600

 

      border=0>

 

        <TBODY>

 

        <TR>

 

          <TD width=15 bgColor=#513439 height=19> </TD>

 

          <TD bgColor=#513439 height=19><FONT

 

          color=#cccccc>网络时空:::::::</FONT></TD></TR></TBODY></TABLE><FONT

 

      color=#cccccc></FONT></TD></TR>

 

  <TR>

 

    <TD vAlign=top>

 

      <TABLE class=f9Copy height=192 cellSpacing=0 cellPadding=0 width=110

 

      border=0>

 

        <TBODY>

 

                <TR>

 

          <TD vAlign=top align=middle height=71>

 

            <P><FONT color=#cccccc>贝利表示,在1998年的世界杯上,法国队在决赛中以30完胜巴西队,这次韩日世界杯将是巴西队复仇的时候了。贝利说,在战胜法国队杀入半决赛之后,巴西队的夺冠道路将较为平坦,尽管对手是葡萄牙、意大利或西班牙这样的劲旅。

 

  贝利表示,他是在搜集分析了各支球队的战绩之后做出上述预测的,他还将这些球队在友谊赛中的成绩也进行了考虑,不过他也坦言:“当然,世界杯还有5个月才正式开始,这期间很多事情都会发生变化。”(清晨)

<BR></FONT></P></TD></TR></TBODY></TABLE></TD></TR></TBODY></TABLE></DIV>

0 Comments

Thu

05

Mar

2009

119、打开真正的全屏窗口

119、打开真正的全屏窗口

脚本说明:

把如下代码加入<body>区域中

<script language="JavaScript">

function aaawin()

{

aaa=window.open('http://www.7stk.com','窗口名','fullscreen=yes')

 

}

</script>

<a href="javascript:aaawin();">网页特效代码</a>

 

0 Comments

Thu

05

Mar

2009

118、子窗口对父窗口的操作

118、子窗口对父窗口的操作

脚本说明:

把如下代码加入<body>区域中

<script>

function aa()

{

a=window.open('about:blank','','width=300;height=300');

tt="<img src=\'cute.gif\'>看见没有,我出来了!</img>"

a.document.write("<input type='button' value='对父窗口操作' onclick='window.opener.dd.innerHTML=\"<img src=cute.gif\>看见没有,我出来了!</img>\"'>");

a.document.close;

}

</script>

<a href="#" onclick="aa()">点击试试看</a>

<div id="dd"></div>

 

0 Comments

Thu

05

Mar

2009

117、Iframe页面的滚动

117Iframe页面的滚动

脚本说明:

把如下代码加入<body>区域中

<iframe id="datamain" src="http://www.7stk.com" width=170 height=150 marginwidth=0 marginheight=0 hspace=0 vspace=0 frameborder=1 scrolling=no></iframe>

<layer visibility=hide>

<div style="width:150px;" align="right">

<a href="#" onMouseover="scrollspeed=-2" onMouseout="scrollspeed=0">向上</a> | <a href="#" onMouseover="scrollspeed=2" onMouseout="scrollspeed=0">向下</a>

</div>

</layer>

 

0 Comments

Thu

05

Mar

2009

116、窗口的缩小居中

116、窗口的缩小居中

脚本说明:

把如下代码加入<head>区域中

<script>

function this_win(w,h){

var ww=window.screen.width*w/100;

var hh=window.screen.height*h/100;

window.resizeTo(ww,hh);

window.moveTo(Math.ceil((window.screen.width-ww)/2),Math.ceil((window.screen.height-hh)/2));

}

</script>

 

<a href="#" onclick="this_win(50,50)">点这里看看</a>

 

0 Comments

Thu

05

Mar

2009

115、新窗口中显示提交内容

115、新窗口中显示提交内容

脚本说明:

把如下代码加入<body>区域中

<script>

var win = null;

function show_choose()

{

       var new_html = '<br><button onclick="window.location=\'about:OK\'">确定</button><button onclick="opener.focus();window.close()">取消</button>'

 

              if(win==null||win.closed)

              {

                     win = window.open("about:blank","choose_window","width=200,height=200,scrolling=yes");

              }

              else

              {

                     win.document.close();                                      

              }    

             

              win.document.write(document.getElementById("the_text").value+new_html);

              win.focus();

}

</script>

<form method="POST" action="javascript:show_choose()">

<input type="text" id="the_text" size="20"><input type="submit" value="提交"><input type="reset" value="全部重写">

</form>

 

0 Comments

Wed

04

Mar

2009

113、页面打开飘动的窗口

113、页面打开飘动的窗口

脚本说明:

第一步:把如下代码加入<body>区域中

<script>

 

var URL= "http://www.7stk.com";

 

// Set size of popup

var W= 130; // not less than 100

var H= 180; // not less than 100

 

// Set margin from edge of screen

var M= 100;

 

// Set speed

var speed = 20;

 

// Set increment of motion

var increment = 16;

 

// Do not edit below this line

//============================

var nowY=M;var nowX=M;

var theWidth=window.screen.width;

var theHeight=window.screen.height;

var limitX=theWidth-W-M;

var limitY=theHeight-H-M;

var s="width="+W+",height="+H;

function doFlyMe(){

P=window.open(URL,"A",s); 

P.resizeTo(W,H);

P.moveTo(M,M);

P.focus();

D();}

function D(){

if (nowY<=limitY){

P.moveTo(nowX,nowY);

P.focus();

nowY+=increment;

T=setTimeout("D()",speed);

}else{

clearTimeout(T);

nowY=limitY;

P.moveTo(nowX,nowY);

P.focus();

R();}}

function R(){

if (nowX<=limitX){

P.moveTo(nowX,nowY);

P.focus();

nowX+=increment;

T=setTimeout("R()",speed);

}else{

clearTimeout(T);

nowX=limitX;

P.moveTo(nowX,nowY);

P.focus();

U();}}

function U(){

if (nowY>=M){

P.moveTo(nowX,nowY);

P.focus();

nowY-=increment;

T=setTimeout("U()",speed);

}else{

clearTimeout(T)

nowY=M;

P.moveTo(nowX,nowY);

P.focus();

L();}}

function L(){

if (nowX>=M){

P.moveTo(nowX,nowY);

P.focus();

nowX-=increment;

T=setTimeout("L()",speed);

}else{

clearTimeout(T);

nowX=M;

P.moveTo(nowX,nowY);

P.focus();}}

 

</script>

第二步:把<body>中的内容改为:

<body  onload="doFlyMe()">

 

0 Comments

Wed

04

Mar

2009

114、无边框打开窗口的集合

114、无边框打开窗口的集合

<script language="javaScript" type="text/javascript" SRC="js/pz_chromeless_2.1.js"></SCRIPT>

<script language=Javascript>

function hover(id,wert){

if(document.all) document.all[id].filters.alpha.opacity = wert;

}

</script>

<script>

<!--

function openIT(url,wtit,wna,w,h) {

theURL=url

wname = wna

W=w;

H=h;

windowCERRARa = "img/close_a.gif" 

windowCERRARd = "img/close_d.gif"

windowCERRARo = "img/close_o.gif"

windowNONEgrf = "img/vficon.gif"

windowCLOCK = "img/clock.gif"

windowREALtit = "------| Design Space |-------"

windowTIT = "<font>------| "+wtit+" |------</font>"

windowBORDERCOLOR = "#000000"

windowBORDERCOLORsel = "#111111"

windowTITBGCOLOR = "#ffcc33"

windowTITBGCOLORsel = "#FFFF99"

openchromeless(theURL, wname, W, H, windowCERRARa, windowCERRARd, windowCERRARo, windowNONEgrf, windowCLOCK, windowTIT, windowREALtit , windowBORDERCOLOR, windowBORDERCOLORsel, windowTITBGCOLOR, windowTITBGCOLORsel)}

function MM_swapImgRestore() { //v3.0

  var i,x,a=document.MM_sr; for(i=0;a&&i<a.length&&(x=a[i])&&x.oSrc;i++)

  x.src=x.oSrc;

  }

function MM_preloadImages() { //v3.0

  var d=document; if(d.images){ if(!d.MM_p) d.MM_p=new Array();

  var i,j=d.MM_p.length,a=MM_preloadImages.arguments; for(i=0; i<a.length;

  i++)

  if (a[i].indexOf("#")!=0){ d.MM_p[j]=new Image; d.MM_p[j++].src=a[i];}}

  }

function MM_findObj(n, d) { //v3.0

  var p,i,x; if(!d) d=document; if((p=n.indexOf("?"))>0&&parent.frames.length)

  {

  d=parent.frames[n.substring(p+1)].document; n=n.substring(0,p);}

  if(!(x=d[n])&&d.all) x=d.all[n]; for (i=0;!x&&i<d.forms.length;i++)

  x=d.forms[i][n];

  for(i=0;!x&&d.layers&&i<d.layers.length;i++) x=MM_findObj(n,d.layers[i].document);

  return x;

  }

function MM_swapImage() { //v3.0

  var i,j=0,x,a=MM_swapImage.arguments; document.MM_sr=new Array; for(i=0;i<(a.length-2);i+=3)

  if ((x=MM_findObj(a[i]))!=null){document.MM_sr[j++]=x; if(!x.oSrc) x.oSrc=x.src;

  x.src=a[i+2];}

  }

  //-->

  </script>

 

0 Comments

Wed

04

Mar

2009

112、窗口打开后的移动

112、窗口打开后的移动

脚本说明:

把如下代码加入<body>区域中:

<script>

 

window.moveTo(0, 0);

 

window.resizeTo(800, 600);

 

window.onresize=new Function("window.resizeTo(800, 600);")

 

</script>

0 Comments

Wed

04

Mar

2009

111、关不掉的窗口

111、关不掉的窗口

脚本说明:

第一步:把如下代码加入<body>区域中

<SCRIPT LANGUAGE="JavaScript">

<!-- Begin

theUrl="poper.htm";

function doThePopUp() {

reWin = window.open(theUrl,'determined','toolbar=no,location=no,directories=no,status=no,menubar=no,scrollbars=no,resizable=no,width=150,height=100,top=100,left=100');

}

//  End -->

</script>

<a href="javascript:doThePopUp()">跳出窗口</a>

 

 

第二步:新建一个poper.htm文件,其html代码为:

<SCRIPT LANGUAGE="JavaScript">

<!-- Begin

theUrl = 'http://www.7stk.com'

lockU = 1

function doAgain() {

if (lockU == 1) {

reWin=window.open(theUrl,'','toolbar=no,location=no,directories=no,status=no,menubar=no,scrollbars=no,resizable=no,width=150,height=100,top=100,left=100')

   }

}

//  End -->

</script>

<BODY onunLoad="doAgain()">

除非你按下面这个<a href="javascript:lockU=0;self.close()">关闭</a>,否则你是关不掉这个窗口的

 

0 Comments

Wed

04

Mar

2009

110、打开窗口控制

110、打开窗口控制

脚本说明:

把如下代码加入<body>区域中

<SCRIPT LANGUAGE="JavaScript">

<!-- Begin

var version4 = (navigator.appVersion.charAt(0) == "4");

var popupHandle;

function closePopup() {

if(popupHandle != null && !popupHandle.closed) popupHandle.close();

}

function displayPopup(position,url,name,height,width,evnt) {

// position=1 POPUP: makes screen display up and/or left, down and/or right

// depending on where cursor falls and size of window to open

// position=2 CENTER: makes screen fall in center

var properties = "toolbar = 0, location = 0, height = " + height;

properties = properties + ", width=" + width;

var leftprop, topprop, screenX, screenY, cursorX, cursorY, padAmt;

if(navigator.appName == "Microsoft Internet Explorer") {

screenY = document.body.offsetHeight;

screenX = window.screen.availWidth;

}

else {

screenY = window.outerHeight

screenX = window.outerWidth

}

if(position == 1)    { // if POPUP not CENTER

cursorX = evnt.screenX;

cursorY = evnt.screenY;

padAmtX = 10;

padAmtY = 10;

if((cursorY + height + padAmtY) > screenY) {

// make sizes a negative number to move left/up

padAmtY = (-30) + (height * -1);

// if up or to left, make 30 as padding amount

}

if((cursorX + width + padAmtX) > screenX)       {

padAmtX = (-30) + (width * -1); 

// if up or to left, make 30 as padding amount

}

if(navigator.appName == "Microsoft Internet Explorer") {

leftprop = cursorX + padAmtX;

topprop = cursorY + padAmtY;

}

else {

leftprop = (cursorX - pageXOffset + padAmtX);

topprop = (cursorY - pageYOffset + padAmtY);

   }

}

else{

leftvar = (screenX - width) / 2;

rightvar = (screenY - height) / 2;

if(navigator.appName == "Microsoft Internet Explorer") {

leftprop = leftvar;

topprop = rightvar;

}

else {

leftprop = (leftvar - pageXOffset);

topprop = (rightvar - pageYOffset);

   }

}

if(evnt != null) {

properties = properties + ", left = " + leftprop;

properties = properties + ", top = " + topprop;

}

closePopup();

popupHandle = open(url,name,properties);

}

//  End -->

</script>

<form name="formtest">

窗口宽度: <input maxlength=3 size=3 type=text value="220" name="testwidth">

窗口高度: <input maxlength=3 size=3 type=text value="120" name="testheight">

<br><a href="javascript:void(0)" onmouseover="window.status='Click for more information'; return true" onClick="displayPopup(1,'http://www.sina.com.cn','popup3',document.formtest.testheight.value,document.formtest.testwidth.value,(version4 ? event : null));">左上角打开(鼠标点击)</a>

<br><a href="javascript:void(0)" onmouseover="window.status='Click for more information'; return true" onClick="displayPopup(2,'http://www.sina.com.cn','popup3',document.formtest.testheight.value,document.formtest.testwidth.value,(version4 ? event : null));">在中间打开(鼠标点击)</a>

<br><a href="javascript:void(0)" onMouseOver="displayPopup(1,'http://www.sina.com.cn','popup1',document.formtest.testheight.value,document.formtest.testwidth.value,(version4 ? event : null))" onMouseOut="closePopup()">左上角打开(鼠标感应)</a>

<br><a href="javascript:void(0)" onMouseOver="displayPopup(2,'http://www.sina.com.cn','popup2',document.formtest.testheight.value,document.formtest.testwidth.value,(version4 ? event : null))" onMouseOut="closePopup()">在中间打开(鼠标感应)</a>

</form>

 

0 Comments

Wed

04

Mar

2009

109、最简弹出无边窗口

109、最简弹出无边窗口

脚本说明:

把如下代码加入<body>区域中

<script>

 

var tmp=window.open("about:blank","","fullscreen=1")

 

tmp.moveTo(100,100)

 

tmp.resizeTo(600,400)

 

tmp.focus()

 

tmp.location="http://www.7stk.com"

 

</script>

0 Comments

Wed

04

Mar

2009

108、无边弹出窗口全集

108、无边弹出窗口全集

脚本说明:

把如下代码加入<body>区域中

<script language=javascript>

 

minimizebar="minimize0826.gif";   //窗口右上角最小化“按钮”的图片

minimizebar2="minimize20826.gif"; //鼠标悬停时最小化“按钮”的图片

closebar="close0826.gif";         //窗口右上角关闭“按钮”的图片

closebar2="close20826.gif";       //鼠标悬停时关闭“按钮”的图片

icon="icon0826.gif";              //窗口左上角的小图标

 

function noBorderWin(fileName,w,h,titleBg,moveBg,titleColor,titleWord,scr)  //定义一个弹出无边窗口的函数,能数意义见下面“参数说明”,实际使用见最后的实例。

/*

------------------参数说明-------------------

fileName   :无边窗口中显示的文件。

w       :窗口的宽度。

h       :窗口的高度。

titleBg    :窗口“标题栏”的背景色以及窗口边框颜色。

moveBg     :窗口拖动时“标题栏”的背景色以及窗口边框颜色。

titleColor :窗口“标题栏”文字的颜色。

titleWord  :窗口“标题栏”的文字。

scr        :是否出现滚动条。取值yes/no或者1/0

--------------------------------------------

*/

{

  var contents="<html>"+

               "<head>"+

                     "<title>"+titleWord+"</title>"+

                        "<meta http-equiv=\"Content-Type\" content=\"text/html; charset=gb2312\">"+

                        "<object id=hhctrl type='application/x-oleobject' classid='clsid:adb880a6-d8ff-11cf-9377-00aa003b7a11'><param name='Command' value='minimize'></object>"+

                        "</head>"+

               "<body topmargin=0 leftmargin=0 scroll=no onselectstart='return false' ondragstart='return false'>"+

                        "  <table height=100% width=100% cellpadding=0 cellspacing=1 bgcolor="+titleBg+" id=mainTab>"+

                        "    <tr height=18 style=cursor:default; onmousedown='x=event.x;y=event.y;setCapture();mainTab.bgColor=\""+moveBg+"\";' onmouseup='releaseCapture();mainTab.bgColor=\""+titleBg+"\";' onmousemove='if(event.button==1)self.moveTo(screenLeft+event.x-x,screenTop+event.y-y);'>"+

                        "      <td width=18 align=center><img height=12 width=12 border=0 src="+icon+"></td>"+

                        "      <td width="+w+"><span style=font-size:12px;color:"+titleColor+";font-family:宋体;position:relative;top:1px;>"+titleWord+"</span></td>"+

                        "      <td width=14><img border=0 width=12 height=12 alt=最小化 src="+minimizebar+" onmousedown=hhctrl.Click(); onmouseover=this.src='"+minimizebar2+"' onmouseout=this.src='"+minimizebar+"'></td>"+

                        "      <td width=13><img border=0 width=12 height=12 alt=关闭 src="+closebar+" onmousedown=self.close(); onmouseover=this.src='"+closebar2+"' onmouseout=this.src='"+closebar+"'></td>"+

                        "    </tr>"+

                        "    <tr height=*>"+

                        "      <td colspan=4>"+

                        "        <iframe name=nbw_v6_iframe src="+fileName+" scrolling="+scr+" width=100% height=100% frameborder=0></iframe>"+

                        "      </td>"+

                        "    </tr>"+

                        "  </table>"+

                        "</body>"+

                        "</html>";

 

  pop=window.open("","_blank","fullscreen=yes");

  pop.resizeTo(w,h);

  pop.moveTo((screen.width-w)/2,(screen.height-h)/2);

  pop.document.writeln(contents);

 

  if(pop.document.body.clientWidth!=w||pop.document.body.clientHeight!=h)  //如果无边窗口不是出现在纯粹的IE窗口中

  {

    temp=window.open("","nbw_v6");

       temp.close();

       window.showModalDialog("about:<"+"script language=javascript>window.open('','nbw_v6','fullscreen=yes');window.close();"+"</"+"script>","","dialogWidth:0px;dialogHeight:0px");

       pop2=window.open("","nbw_v6");

    pop2.resizeTo(w,h);

    pop2.moveTo((screen.width-w)/2,(screen.height-h)/2);

    pop2.document.writeln(contents);

       pop.close();

  }

}

</script>

 

<!----------------- 实例一(按钮),修改参数可改变窗口样式 ----------------->

<button onclick=noBorderWin('test0826.html','400','240','#000000','#333333','#CCCCCC','一个无边窗口的测试例子','yes');>open</button>

 

<br><br>

 

<!----------------- 实例二(链接),修改参数可改变窗口样式 ----------------->

<a href=#none onclick=noBorderWin('test0826.html','400','240','#000000','#333333','#CCCCCC','一个无边窗口的测试例子','yes');>open</a>

 

<br><br>

 

<!----------------- 实例三(图片),修改参数可改变窗口样式 ----------------->

<img src=none height=30 width=60 alt=open style="cursor:hand" onclick=noBorderWin('test0826.html','400','240','#000000','#333333','#CCCCCC','一个无边窗口的测试例子','no');>无滚动条的

0 Comments

Wed

04

Mar

2009

107、flash的超酷播放

107flash的超酷播放

脚本说明:

把如下代码加入<body>区域中

<script>

function open1(url){

newwin=window.open(url,'newwindow','fullscreen=1')

newwin.resizeTo(550,400)

newwin.moveTo(screen.width/2-275,screen.height/2-200)

}

</script>

<A href='javascript:open1("20030208.htm")'>简单爱</a>

0 Comments

Wed

04

Mar

2009

106、打开图片的窗口

106、打开图片的窗口

脚本说明:

把如下代码加入<body>区域中

<SCRIPT>

function DynaWin(url, h, w, l, t) {

poph = + h + 70

popw = + w + 30

disp = window.open("","pop","height=" + poph + ",width=" + popw + ",left=" + l + ",top=" + t + "");

content = '<HTML>';

content += '<TITLE>弹出窗口</TITLE>';

content += '</HEAD>';

content += '<BODY BACKGROUND="yourfile" onBlur="self.close()">';

content += '<P ALIGN="CENTER"><img src="path to image' + url + '" height="' + h + '" width="' + w + '"></P>';

content += '<H3 ALIGN="CENTER"><A HREF="#" onClick="self.close()">关闭窗口</A></H3>';

content += '</BODY></HTML>';

disp.document.write(content);

disp.document.close();

}

</SCRIPT>

<A HREF="#" onClick="DynaWin('photo2.jpg', '300', '300', '30', '30')";>打开图片</A>

 

0 Comments

Wed

04

Mar

2009

105、弹出窗口的完全控制

105、弹出窗口的完全控制

<body bgcolor="#FFFFFF" text="#000000" leftmargin="0" topmargin="0" onload="inithandle();" onunload="if (newwin!=null)newwin.close();">

<script language="JavaScript">

<!--

var newwin=null;

function inithandle() {

handle.style.left=(box.offsetWidth-handle.offsetWidth)/2+10;

handle.style.top=(box.offsetHeight-handle.offsetHeight)/2+10;

if (newwin!=null) newwin.moveTo((screen.Width-newwin.window.document.body.offsetWidth)/2,(screen.Height-newwin.window.document.body.offsetHeight)/2);

}

 

var url='http://www.cctv.com';

function openwin() {

inithandle();

if (newwin==null) {

newwin=window.open(url,'newwin','fullscreen=yes');openbutton.disabled=true;closebutton.disabled=false;}

var w=screen.Width/box.offsetWidth*handle.offsetWidth;

var h=screen.Height/box.offsetHeight*handle.offsetHeight;

newwin.resizeTo(w,h);

var l=(screen.Width-w)/2;

var t=(screen.Height-h)/2;

newwin.moveTo(l,t);

}

var dragenable=0;

var obj;

var dx0;

var dy0;

function dragstart(objname) {

obj=objname;

dragenable=1;

dx0=document.body.scrollLeft+event.clientX-obj.offsetLeft;

dy0=document.body.scrollTop+event.clientY-obj.offsetTop;

}

 

 

function draglayer() {

if (dragenable==1) {

obj.setCapture();

var x=document.body.scrollLeft+event.clientX-dx0;

var y=document.body.scrollTop+event.clientY-dy0;

       if (x>box.offsetLeft && x<box.offsetLeft+box.offsetWidth-obj.offsetWidth && y>box.offsetTop && y<box.offsetTop+box.offsetHeight-obj.offsetHeight) {

              obj.style.left=x;

              obj.style.top=y;

              }

       else if (x<box.offsetLeft) {

              obj.style.left=box.offsetLeft;

              if (y<box.offsetTop) {

                     obj.style.top=box.offsetTop;

                     }

              else if (y>box.offsetTop+box.offsetHeight-obj.offsetHeight) {

                     obj.style.top=box.offsetTop+box.offsetHeight-obj.offsetHeight;

                     }

              else {

                     obj.style.top=y;

                     }

              }

       else if (x>box.offsetLeft+box.offsetWidth-obj.offsetWidth) {

              obj.style.left=box.offsetLeft+box.offsetWidth-obj.offsetWidth;

              if (y<box.offsetTop) {

                     obj.style.top=box.offsetTop;

                     }

              else if (y>box.offsetTop+box.offsetHeight-obj.offsetHeight) {

                     obj.style.top=box.offsetTop+box.offsetHeight-obj.offsetHeight;

                     }

              else {

                     obj.style.top=y;

                     }

              }

       else {

              obj.style.left=x;

              if (y<box.offsetTop) {

                     obj.style.top=box.offsetTop;

                     }

              else if (y>box.offsetTop+box.offsetHeight-obj.offsetHeight) {

                     obj.style.top=box.offsetTop+box.offsetHeight-obj.offsetHeight;

                     }

              else {

                     obj.style.top=y;

                     }

              }

       if (newwin!=null)   {

              newwin.moveTo((obj.offsetLeft-10)*screen.Width/box.offsetWidth,(obj.offsetTop-10)*screen.Height/box.offsetHeight);

              }

       }

}

 

function dragend() {

dragenable=0;

obj.releaseCapture();

}

 

function changesize(zoomvalue) {

if (zoomvalue=='+' && handle.offsetWidth<200) {

       handle.style.pixelWidth+=4;

       handle.style.pixelHeight=handle.offsetWidth/box.offsetWidth*box.offsetHeight;

       }

if (zoomvalue=='-' && handle.offsetWidth>28) {

       handle.style.pixelWidth-=4;

       handle.style.pixelHeight=handle.offsetWidth/box.offsetWidth*box.offsetHeight;

       }

if (zoomvalue=='0') {

       handle.style.width=28;

       handle.style.height=21;

       }

if (newwin!=null)   {

       var w=screen.Width/box.offsetWidth*handle.offsetWidth;

       var h=screen.Height/box.offsetHeight*handle.offsetHeight;

       newwin.resizeTo(w,h);

       }

inithandle();

}

 

function setbg() {

if (newwin!=null)   {

       if(bgcolorvalue.value!='')       {newwin.document.body.style.backgroundColor="#"+bgcolorvalue.value;handle.style.backgroundColor="#"+bgcolorvalue.value;}

       newwin.document.body.style.backgroundImage='url('+bgimgvalue.value+')';

       }

}

 

function setborder() {

if (newwin!=null)   {

       if(bordercolorvalue.value!='')       {newwin.document.body.style.borderColor="#"+bordercolorvalue.value;handle.style.borderColor="#"+bordercolorvalue.value;}

       if(borderwidthvalue.value=='0')       {newwin.document.body.style.borderWidth=borderwidthvalue.value;handle.style.borderWidth=0;}

       else if(borderwidthvalue.value!='')       {newwin.document.body.style.borderWidth=borderwidthvalue.value;handle.style.borderWidth=1;}

       if(bordercolorvalue.value!='')       {newwin.document.body.style.borderStyle=borderstylevalue.value;handle.style.borderStyle=borderstylevalue.value;}

       }

}

 

function setmargin() {

if (newwin!=null)   {

       if(marginvalue.value!='')       {newwin.document.body.style.margin=marginvalue.value;}

       }

}

 

function setscroll() {

if (newwin!=null)   {

       if(checkscroll.checked) {newwin.document.body.scroll='yes';}

       else {newwin.document.body.scroll='no';}

       }

}

 

function setbgfix() {

if (newwin!=null)   {

       if(checkfix.checked) {newwin.document.body.style.backgroundAttachment='fixed';}

       else {newwin.document.body.style.backgroundAttachment='scroll';}

       }

}

 

function setbgrepeat() {

if (newwin!=null)   {

       if(checkrepeat.checked) {newwin.document.body.style.backgroundRepeat='no-repeat';}

       else {newwin.document.body.style.backgroundRepeat='repeat';}

       }

}

 

var trackrepeat;

function showtrack() {

handle.style.visibility='hidden';

trackbox.style.visibility='visible';

drawbox.style.visibility='visible';

}

 

function playtrack() {

handle.style.visibility='visible';

trackbox.style.visibility='hidden';

drawbox.style.visibility='hidden';

if (playtrackbutton.value=='Play Track') {showtrackbutton.disabled=true;playtrackbutton.value='Stop Track';playnode(axiscount2);}

else {clearTimeout(trackrepeat);showtrackbutton.disabled=false;playtrackbutton.value='Play Track';}

 

}

 

var axis=new Array();

var axiscount=0;

var axiscount2=0;

var drawenable=0;

var drawenable2=0;

 

function initnode() {

drawenable=1;

}

 

function drawnode() {

if (drawenable==1 && drawenable2==1) {

playtrackbutton.disabled=true;

       var tempx=document.body.scrollLeft+event.clientX-trackbox.offsetLeft;

       var tempy=document.body.scrollTop+event.clientY-trackbox.offsetTop;

       if (tempx>-1 && tempx<trackbox.offsetWidth-1 && tempy>-1 && tempy<trackbox.offsetHeight-1) {

              axis[axiscount]=tempx;

              axis[axiscount+1]=tempy;

              if (axiscount%4==0 && axiscount%20!=0)

              trackbox.innerHTML+='<img src=images/spacer.gif width=1 height=1 style="background-color:#999999;position:absolute;left:'+axis[axiscount]+';top:'+axis[axiscount+1]+'">';

              if (axiscount%20==0)

              trackbox.innerHTML+='<img src=images/spacer.gif width=2 height=2 style="background-color:#FF0000;position:absolute;left:'+axis[axiscount]+';top:'+axis[axiscount+1]+'">';

              axiscount+=2;

              trackbox.setCapture();

              }

       }

}

 

function playnode(i) {

if (i<axis.length) {

       handle.style.left=axis[i]-14+trackbox.offsetLeft;

       handle.style.top=axis[i+1]-11+trackbox.offsetTop;

       if (newwin!=null)   {

              newwin.moveTo((handle.offsetLeft-10)*screen.Width/box.offsetWidth,(handle.offsetTop-10)*screen.Height/box.offsetHeight);

              }

       axiscount2+=2;

       trackrepeat=setTimeout('playnode('+axiscount2+')',10);

       }

else {axiscount2=0;showtrackbutton.disabled=false;playtrackbutton.value='Play Track';clearTimeout(trackrepeat);}

}

 

function endnode() {

drawenable=0;

drawenable2=0;

drawbox.style.visibility='visible';

trackbox.releaseCapture();

playtrackbutton.disabled=false;

}

 

function cleartrack() {

axis=new Array();

axiscount=0;

drawbox.style.visibility='hidden';

drawenable2=1;

trackbox.innerHTML='';

}

// -->

</script>

<style>

.button2 { border:2px inset #FFFFFF}

.button { background-color:menu;border:2px outset #FFFFFF}

td,a,body,input {font-size:10px;font-family:Verdana}

</style>

<table width=220 cellspacing=0 cellpadding=0 border=0>

<tr>

<td height=170 align="center" class=button>

<table width="204" border="0" cellspacing="0" cellpadding="0" class=button2>

<tr>

<td valign="top" height="150">¡¡</td>

</tr>

</table></td></tr>

<tr>

<td align=center>

<input type="button" value="Open" onfocus="this.blur()" onclick="openwin()" style="width:100%" id=openbutton><br>

<input type="button" value="Close" onfocus="this.blur()" onclick="if (newwin!=null)newwin.close();" style="width:100%" id=closebutton disabled><br>

<input type="button" value="Size +" onfocus="this.blur()" onclick="changesize('+')" style="width:100%"><br>

<input type="button" value="Size -" onfocus="this.blur()" onclick="changesize('-')" style="width:100%"><br>

<input type="button" value="Restore" onfocus="this.blur()" onclick="changesize('0')" style="width:100%"><br>

</td>

</tr>

<tr>

<td align=center height=100 class=button valign="top">

<table width="100%" border="0" cellspacing="5" cellpadding="0">

<tr>

<td valign="top" width="50%">

<table width="100%" cellpadding="0" cellspacing="0">

<tr>

<td>

<fieldset>

<legend>Background</legend>

<table width="100%" cellpadding="0" cellspacing="0">

<tr>

<td> Color</td><td><input type=textfield id=bgcolorvalue size=6 onkeypress="if (event.keyCode==13)setbg()" onblur="setbg()" value="666699"></td>

</tr>

<tr>

<td> Image</td><td><input type=textfield id=bgimgvalue size=6 onkeypress="if (event.keyCode==13)setbg()" onblur="setbg()"></td>

</tr>

<tr>

<td colspan=2><input type="checkbox" id="checkfix" value="checkbox" onclick="setbgfix()" onfocus="this.blur()"> Fix<input type="checkbox" id="checkrepeat" value="checkbox" onclick="setbgrepeat()" onfocus="this.blur()"> Tiled

</td>

</tr>

</table>

</fieldset>

<fieldset>

<legend>Margin</legend>

<table width="100%" cellpadding="0" cellspacing="0">

<tr>

<td> Width</td><td><input type=textfield id=marginvalue size=6 onkeypress="if (event.keyCode==13)setmargin()" onblur="setmargin()" value=0></td>

</tr>

</table>

</fieldset>

</td>

</tr>

</table>

</td>

<td valign="top" width="50%">

<table width="100%" cellpadding="0" cellspacing="0">

<tr>

<td>

<fieldset>

<legend>Border</legend>

<table width="100%" cellpadding="0" cellspacing="0">

<tr>

<td> Color</td><td><input type=textfield id=bordercolorvalue size=6 onkeypress="if (event.keyCode==13)setborder()" onblur="setborder()" value="666699"></td>

</tr>

<tr>

<td> Width</td><td><input type=textfield id=borderwidthvalue size=6 onkeypress="if (event.keyCode==13)setborder()" onblur="setborder()" value=0></td>

</tr>

<tr>

<td> Style</td><td><input type=textfield id=borderstylevalue size=6 onkeypress="if (event.keyCode==13)setborder()" onblur="setborder()" value=solid></td>

</tr>

</table>

</fieldset>

<fieldset>

<legend>Scroll</legend>

<table width="100%" cellpadding="0" cellspacing="0">

<tr>

<td><input type="checkbox" id="checkscroll" value="checkbox" onclick="setscroll();" onfocus="this.blur()"> Scroll

</td>

</tr>

</table>

</fieldset>

</td>

</tr>

</table>

</td>

</tr>

</table>

</td>

</tr>

<tr>

<td align=center>

<input type="button" value="Show Track" onfocus="this.blur()" onclick="showtrack()" style="width:100%" id=showtrackbutton><br>

<input type="button" value="Play Track" onfocus="this.blur()" onclick="playtrack()" style="width:100%" id=playtrackbutton><br>

</td>

</tr>

</table>

<div id="box" style="position:absolute; width:200px; height:150px; z-index:1; left: 10px; top: 10px; background-color: #FFFFFF; border: 1px none #000000">

</div>

<div id="handle" style="font-size:5px;line-height:5px;position:absolute; width:28px; height:21px; z-index:2; left: 10px; top: 10px; background-color: #666699; border: 1px none #000000;cursor:move" onmousedown="dragstart(this)" onmousemove="draglayer()" onmouseup="dragend()"></div>

<div id="trackbox" style="position:absolute; width:172px; height:129px; z-index:1; left: 24px; top: 21px; border: 1px solid #EAEAEA; background-color: #FAFAFA; visibility: hidden" onmousemove=drawnode() onmousedown=initnode() onmouseup=endnode()>

<table width="100%" height="100%" cellspacing="0" cellpadding="0" border="0">

<tr>

<td align="center" style="color:#FF0000">(Empty)</td>

</tr>

</table>

</div>

<div id="drawbox" style="text-align:center;position:absolute; width:172px; height:14px; z-index:1; left: 24px; top: 136px; background-color: #CCCCCC; border: 1px none #EAEAEA; visibility: hidden; color: #FFFFFF" onclick="cleartrack()">ReDraw Track

</div>

0 Comments

Wed

04

Mar

2009

104、自动关闭的层

104、自动关闭的层

脚本说明:

把如下代码加入<body>区域中

<SCRIPT language=JavaScript>

timePopup=5;var ns=(document.layers);var ie=(document.all);var w3=(document.getElementById && !ie);adCount=0;

function initPopup(){if(!ns && !ie && !w3) return;if(ie) adDiv=eval('document.all.lbplocation.style');else if(ns) adDiv=eval('document.layers["lbplocation"]');else if(w3) adDiv=eval('document.getElementById("lbplocation").style');if (ie||w3) adDiv.visibility="visible";else adDiv.visibility ="show";showPopup();}

function showPopup(){if(adCount<timePopup*10){adCount+=1;if (ie){documentWidth  =document.body.offsetWidth/2+document.body.scrollLeft-20;documentHeight =document.body.offsetHeight/2+document.body.scrollTop-20;} else if (ns){documentWidth=window.innerWidth/2+window.pageXOffset-20;documentHeight=window.innerHeight/2+window.pageYOffset-20;} else if (w3){documentWidth=self.innerWidth/2+window.pageXOffset-20;documentHeight=self.innerHeight/2+window.pageYOffset-20;} adDiv.left=documentWidth-250;adDiv.top =documentHeight-150; setTimeout("showPopup()",100);}else closePopup();}

function closePopup(){if (ie||w3) adDiv.display="none"; else adDiv.visibility ="hide";}

onload=initPopup;

</SCRIPT>

<DIV id=lbplocation style="HEIGHT: 1px; LEFT: 50px; POSITION: absolute; TOP: 100px; VISIBILITY: hidden; WIDTH: 1px">

            <TABLE bgColor=#35726c height=320

            style="BORDER-BOTTOM: #ecf6f5 1px outset; BORDER-LEFT: #ecf6f5 1px outset; BORDER-RIGHT: #ecf6f5 1px outset; BORDER-TOP: #ecf6f5 1px outset"

            width=520>

              <TBODY>

              <TR>

                <TD>

                  <TABLE align=center bgColor=#83c6c0 height=290

                  style="BORDER-BOTTOM: #fafdfd 1px inset; BORDER-LEFT: #fafdfd 1px inset; BORDER-RIGHT: #fafdfd 1px inset; BORDER-TOP: #fafdfd 1px inset"

                  width=490>

                    <TBODY>

                    <TR>

                      <TD align=middle vAlign=center><BR><BR><B><A

                        href="register.cgi"

                        title=按这里进行注册><U>注 册</U></A>  <A

                        href="loginout.cgi?forum=44"

                        title=从这里开始进入论坛><U>登 入</U></A></B>

                        <P>(此视窗将于 5 秒后自动关闭)</P></TD></TR></TBODY></TABLE></TD></TR></TBODY></TABLE></DIV>

0 Comments

Wed

04

Mar

2009

103、窗口中间弹出

103、窗口中间弹出

脚本说明:

把如下代码加入<body>区域中

<script>

window.open("http://www.huicui.jimdo.com","","width=400,height=240,top="+(screen.availHeight-240)/2+",left="+(screen.availWidth-400)/2);

</script>

0 Comments

Wed

04

Mar

2009

102、窗口延时弹出

102、窗口延时弹出

脚本说明:

把如下代码加入<body>区域中

<script type="text/javascript">

function writeText() {

    window.open("http://www.7stk.com");

}

setTimeout("writeText()",20000);

</script>

0 Comments

Wed

04

Mar

2009

101、跑马灯式样的站点栏目指南

101、跑马灯式样的站点栏目指南

脚本说明:

把如下代码加入<body>区域中(你可以对链接及说明作相应修改)

 

<div id="tooltip2" style="position:absolute;visibility:hidden;clip:rect(0 150 50 0);width:150px;background-color:seashell">

<layer name="nstip" width=1000px bgColor="seashell"></layer>

</div>

<SCRIPT language="JavaScript">

<!--

if (!document.layers&&!document.all)

event="test"

function showtip2(current,e,text){

 

if (document.all&&document.readyState=="complete"){

document.all.tooltip2.innerHTML='<marquee style="border:1px solid black">'+text+'</marquee>'

document.all.tooltip2.style.pixelLeft=event.clientX+document.body.scrollLeft+10

document.all.tooltip2.style.pixelTop=event.clientY+document.body.scrollTop+10

document.all.tooltip2.style.visibility="visible"

}

 

else if (document.layers){

document.tooltip2.document.nstip.document.write('<b>'+text+'</b>')

document.tooltip2.document.nstip.document.close()

document.tooltip2.document.nstip.left=0

currentscroll=setInterval("scrolltip()",100)

document.tooltip2.left=e.pageX+10

document.tooltip2.top=e.pageY+10

document.tooltip2.visibility="show"

}

}

function hidetip2(){

if (document.all)

document.all.tooltip2.style.visibility="hidden"

else if (document.layers){

clearInterval(currentscroll)

document.tooltip2.visibility="hidden"

}

}

 

function scrolltip(){

if (document.tooltip2.document.nstip.left>=-document.tooltip2.document.nstip.document.width)

document.tooltip2.document.nstip.left-=5

else

document.tooltip2.document.nstip.left=150

}

//-->

 

 

</SCRIPT>

        <table border="0">

      <tr>

        <td><font face="Arial, Helvetica, sans-serif" size="3"><b>

          <a href="ye0.htm" onMouseOver="showtip2(this,event,'字符从天而降!')" onMouseOut="hidetip2()">新的链接</a></b></font></td>

        <td><font face="Arial, Helvetica, sans-serif" size="3"><b><a href="ye1.htm" onMouseOver="showtip2(this,event,'状态栏跑马灯1!')" onMouseOut="hidetip2()">新的链接</a></b></font></td>

        <td><font face="Arial, Helvetica, sans-serif" size="3"><b><a href="ye2.htm" onMouseOver="showtip2(this,event,'状态栏跑马灯2!')" onMouseOut="hidetip2()">新的链接</a>

          </b></font></td>

        <td><font face="Arial, Helvetica, sans-serif" size="3"><b><a href="ye3.htm" onMouseOver="showtip2(this,event,'页面自动滚屏效果!')" onMouseOut="hidetip2()">新的链接</a>

          </b></font></td>

      </tr>

      <tr>

        <td><font face="Arial, Helvetica, sans-serif" size="3"><b><a href="ye1.htm" onMouseOver="showtip2(this,event,'隐藏显示字符脚本!')" onMouseOut="hidetip2()">新的链接</a></b></font></td>

        <td><font face="Arial, Helvetica, sans-serif" size="3"><b><a href="ye2.htm" onMouseOver="showtip2(this,event,'滚动显示的LOGO!')" onMouseOut="hidetip2()">新的链接</a></b></font></td>

        <td><font face="Arial, Helvetica, sans-serif" size="3"><b><a href="ye3.htm" onMouseOver="showtip2(this,event,'鼠标跟踪器!')" onMouseOut="hidetip2()">新的链接</a></b></font></td>

        <td> </td>

      </tr>

    </table>

 

 

0 Comments

Wed

04

Mar

2009

100、链接处变换色彩

100、链接处变换色彩

脚本说明:

第一步:把如下代码加入<head>区域中

<SCRIPT LANGUAGE="JavaScript">

<!-- Begin

function initArray() {

for (var i = 0; i < initArray.arguments.length; i++) {

this[i] = initArray.arguments[i];

}

this.length = initArray.arguments.length;

}

var colors = new initArray(

"red",

"blue",

"green",

"purple",

"black",

"tan",

"yellow",

"lime",

"coral",

"palegreen",

"silver",

"gold",

"red");

delay = .5; // seconds

link = 0;

vlink = 0;

function linkDance() {

link = (link+1)%colors.length;

vlink = (vlink+1)%colors.length;

document.linkColor = colors[link];

document.vlinkColor = colors[vlink];

setTimeout("linkDance()",delay*1000);

}

linkDance();

// End -->

</script>

 

那么链接处就会出现彩色字体

注意:不能在<style>中定义好链接颜色

0 Comments

Wed

04

Mar

2009

99、查看源代码按钮

99、查看源代码按钮

脚本说明:

把如下代码加入<body>区域中

<input type="BUTTON" value="查看源代码" onClick= 'window.location = "view-source:" + window.location.href' name="BUTTON">

0 Comments

Wed

04

Mar

2009

98、弹出浏览器的版本信息??

98、弹出浏览器的版本信息??

 

 

0 Comments

Wed

04

Mar

2009

97、前进后退按钮

97、前进后退按钮

脚本说明:

把如下代码加入<body>区域中

<script language="VBScript">

<!--

Sub GoForward()

 form1.btn2.value="正在前进"

 history.go(1)

end sub

 

Sub GoBack()

 form1.btn1.value="正在后退"

 history.go(-1)

end sub

-->

</script>

                  <form name=form1>

                    <input type="button"  name="btn1" value="<<后退" onClick="GoBack">

                    <input type="button"  name="btn2" value="前进>>" onClick="GoForward">

                  </form>

0 Comments

Wed

04

Mar

2009

96、按钮打开全屏窗口

96、按钮打开全屏窗口

脚本说明:

把如下代码加入<body>区域中

<script>

<!--

function winopen(){

var targeturl="http://www.7stk.com"

newwin=window.open("","","scrollbars")

if (document.all){

newwin.moveTo(0,0)

newwin.resizeTo(screen.width,screen.height)

}

newwin.location=targeturl

}

//-->

</script>

  <input type="button" onClick="winopen()" value="网页特效代码" name="button">

 

0 Comments

Wed

04

Mar

2009

95、自由打开各种窗口

95、自由打开各种窗口

脚本说明:

把如下代码加入<body>区域中

<script language="JAVASCRIPT">

<!--  hide       

 

function customize(form) {   

        var address = document.form1.url.value;  

        var op_tool  = (document.form1.tool.checked== true)  ? 1 : 0;   

        var op_loc_box  = (document.form1.loc_box.checked == true)  ? 1 : 0;   

        var op_dir  = (document.form1.dir.checked == true)  ? 1 : 0;   

        var op_stat  = (document.form1.stat.checked == true)  ? 1 : 0;   

        var op_menu  = (document.form1.menu.checked == true)  ? 1 : 0;   

        var op_scroll  = (document.form1.scroll.checked == true)  ? 1 : 0;   

        var op_resize  = (document.form1.resize.checked == true)  ? 1 : 0;   

        var op_wid  = document.form1.wid.value;  

        var op_heigh = document.form1.heigh.value;                

        var option = "toolbar="      + op_tool +                ",location="    + op_loc_box +                ",directories="

        + op_dir +                ",status="      + op_stat

        +                ",menubar="     + op_menu +                ",scrollbars=" 

 

        + op_scroll +                ",resizeable="  + op_resize

        +                ",width="      

        + op_wid +                ",height="      + op_heigh;

        var win3 = window.open("", "what_I_want", option); 

        var win4 = window.open(address, "what_I_want");

}

function clear(form){

        document.form1.wid.value="";

        document.form1.heigh.value="";

}

// done hiding -->

</script>

 

 <form name="form1" action="javascript:" method="POST">

                    <div align="left">

                      <table width="100%" border="0" cellspacing="0" cellpadding="0">

                        <tr align="center">

                          <td colspan="4" height="35"> URL

                            <input type="text" size="40" name="url" value="http://">

                          </td>

                        </tr>

                        <tr align="center">

                          <td width="25%" height="25">

                            <input

type="checkbox" name="tool" value="ON">

                            : 快捷键</td>

                          <td width="25%" height="25">

                            <input type="checkbox" name="loc_box" value="ON">

                            : 地址栏 </td>

                          <td width="25%" height="25">

                            <input

type="checkbox" name="dir" value="ON">

                            : </td>

                          <td width="25%" height="25">

                            <input type="checkbox" name="stat" value="ON">

                            : 状态栏</td>

                        </tr>

                        <tr align="center">

                          <td width="25%" height="25">

                            <input

type="checkbox" name="resize" value="ON">

                            : 调大小 </td>

                          <td width="25%" height="25">

                            <input type="checkbox" name="scroll" value="ON">

                            : 滚动条</td>

                          <td width="25%" height="25">

                            <input

type="checkbox" name="menu" value="ON">

                            : </td>

                          <td width="25%" height="25"> </td>

                        </tr>

                        <tr align="center">

                          <td colspan="2" height="35">

                            <input type="text" name="wid"

size="14">

                            : </td>

                          <td colspan="2" height="25">

                            <input type="text" name="heigh" size="14">

                            : </td>

                        </tr>

                        <tr align="center">

                          <td colspan="4" height="25">

                            <input

type="button" size="10" value="确认" onClick="customize(this.form)" name="button">

                            <input type="reset"

size="10" value="重填" onClick="clear(this.form)" name="reset">

                          </td>

                        </tr>

                      </table>

                    </div>

                  </form>

0 Comments

Wed

04

Mar

2009

94、按钮特殊效果

94、按钮特殊效果

脚本说明:

第一步:把如下代码加入<head>区域中

<style type="text/css">

<!--

.over {color:yellow; background: navy}

.down {color:yellow; background: navy; font-style: italic}

-->

</style>

 

 

第二步:<body>区中加入如下代码

<input

type="Button"

onMouseOver="this.className='over';"

onMouseOut="this.className='';"

onMouseDown="this.className='down';"

onMouseUp="this.className='over';"

value="按钮也疯狂"

onClick="this.value='我真的好喜欢你!'" name="Button">

0 Comments

Wed

04

Mar

2009

93、浏览器全屏显示

93、浏览器全屏显示

脚本说明:

把如下代码加入<body>区域中

<form>

<div align="center">

<input type="BUTTON" name="FullScreen" value="全屏显示" onClick="window.open(document.location, 'big', 'fullscreen=yes')">

</div>

</form>

 

0 Comments

Wed

04

Mar

2009

92、跳出说明窗口

92、跳出说明窗口

脚本说明:

把如下代码加入<body>区域中

<SCRIPT LANGUAGE="Javascript">

 

// Please enter the number of people in your database

var peepNum = 6

 

// Please edit your page attributes here

var pageAtr = new Array(1)

pageAtr[0] = "#000000"                        // Pop Up Profile background color

pageAtr[1] = "#ffffff"                        // Pop Up Profile text color

 

// Please edit the names of the people in your profiles

var peepName = new Array(peepNum)

peepName[1] = "Jason"                         // First person's name

peepName[2] = "John"                          // Second person's name

peepName[3] = "Joe"                           // Etc...

peepName[4] = "Ryan"

peepName[5] = "Jessica"

peepName[6] = "Mrs. Jacobson"

 

// Please edit the people's positions

var peepPos = new Array(peepNum)

peepPos[1] = "Master programmer :P"           // First person's position

peepPos[2] = "The Pascal Guy"                 // Second person's position

peepPos[3] = "Soccer guy and mudder"          // Etc...

peepPos[4] = "Serves no useful function"

peepPos[5] = "She complains a lot"

peepPos[6] = "The *snicker snicker* teacher"

 

// Please edit the personal quote

var peepAd = new Array(peepNum)

peepAd[1] = "9th grade really bites"          // First person's quote

peepAd[2] = "Graphix are easier"              // Second person's quote

peepAd[3] = "I like to play muds"             // Etc...

peepAd[4] = "Huh? What about what?"

peepAd[5] = "I don't understand..."

peepAd[6] = "There's too much screwing around here"

 

// *#)*#)*#)*#)*#)*#)*#)*#)*#)*#)*#)*#)*#)*#)*#)*#)*#)

// *#)      Please stop editing at this point      *#)

// *#)*#)*#)*#)*#)*#)*#)*#)*#)*#)*#)*#)*#)*#)*#)*#)*#)

 

function makePupWin(){

  PUP = window.open('','PUP','width=300,height=160,toolbar=0,directories=0,status=1,menu=0,scrollbars=no,resizable=no,copyhistory=no,location=0');

}

 

// This is a bit hard to edit if you don't do javascript.

// Here you can edit the HTML of the profile window

// Keep in mind you'll get errors if you use " without a slash (\")

function makePUP(num){

  makePupWin();

  PUP.document.write("<HTML>\n<HEAD>\n<TITLE>Profile for: " + peepName[num] + "</TITLE>");

  PUP.document.write("\n</HEAD>\n<BODY BGCOLOR=\"" + pageAtr[0] + "\" TEXT=\"" + pageAtr[1] + "\">");

  PUP.document.write("\n<CENTER>\n<TABLE WIDTH=\"250\" BORDER=\"1\" HEIGHT=\"100\">\n<TR>\n<TD>Name</TD><TD><CENTER>" + peepName[num] + "</CENTER></TD>");

  PUP.document.write("\n<\TR>\n<TR>\n<TD>Title:</TD><TD><CENTER>" + peepPos[num] + "</CENTER></TD>");

  PUP.document.write("\n<\TR>\n<TR>\n<TD>Quote:</TD><TD><CENTER>" + peepAd[num] + "</CENTER></TD>");

  PUP.document.write("\n<\TR>\n</TABLE>\n<FORM>\n<INPUT TYPE=\"button\" VALUE=\"Close Profile\" onClick=\"self.close();\">\n</FORM>\n</BODY>\n</HTML>");

  PUP.status=(peepName[num] + "'s Pop Up Profile");

  PUP.document.close();

}

</SCRIPT>

<CENTER>

<FORM>

<INPUT TYPE="button" VALUE="Jason's profile" onClick="makePUP(1)"><P>

<INPUT TYPE="button" VALUE="John's profile" onClick="makePUP(2)"><P>

<INPUT TYPE="button" VALUE="Joe's profile" onClick="makePUP(3)"><P>

<INPUT TYPE="button" VALUE="Ryan's profile" onClick="makePUP(4)"><P>

<INPUT TYPE="button" VALUE="Jessica's profile" onClick="makePUP(5)"><P>

<INPUT TYPE="button" VALUE="Mrs. Jacobson's profile" onClick="makePUP(6)"><P>

</FORM>

</CENTER>

0 Comments

Wed

04

Mar

2009

91、关不掉的跳出框

91、关不掉的跳出框

脚本说明:

把如下代码加入<body>区域中:

<input type=button value=hmm onClick="var e=1;while(1==1){alert('你是关不掉我的!!!')}">

0 Comments