///pc/img/blank.gif" width="12" height="8">当前位置:///default.htm" class="under">亿度网络 -> ///pc/index.htm" class="under">网页制作教程 -> JavaScript实例
///pc/homepage/javascript/sample/img/bule.gif" width="207" height="13"> ///pc/homepage/javascript/sample/img/blank.gif" width="1" height="1"> ///pc/homepage/javascript/sample/img/js.gif" width="186" height="20"> ///pc/homepage/javascript/sample/img/blank.gif" width="1" height="1">
///pc/homepage/javascript/sample/img/blank.gif" width="1" height="1"> ///pc/homepage/javascript/sample/img/blank.gif" width="1" height="1">
    窗口从天而降效果 ///pc/homepage/javascript/sample/img/blank.gif" width="1" height="1">  
    ///pc/homepage/javascript/sample/img/bule1.gif" width="28" height="49">  
效 果 演 示 ///pc/homepage/javascript/sample/img/bule2.gif" width="11" height="18">

 

怎麽样?看到效果了吗?有点气魄吧!

若没看见,就刷新一下屏幕再看一次吧!

 

   
 
源代码如下 ///pc/homepage/javascript/sample/img/bule2.gif" width="11" height="18">



这段程序放在<head>与</head>之间

这段程序放在<body ****>正文中


   
源程序讲解: ///pc/homepage/javascript/sample/img/bule2.gif" width="11" height="18">
  ///pc/homepage/javascript/sample/img/bule1.gif" width="28" height="49">  

function drop(n)
定义一个函数,名为drop。
{ if(self.moveBy)
{ self.moveBy (0,-900);
如果当前的窗口存在,就移动到相对于当前窗口正上方900像素的地方,moveby函数表示相对位置。
for(i = n; i > 0; i--)
{ self.moveBy(0,3); }
此例中n=300,每次相对当前窗口向下移动3个像素。
for(j = 8; j > 0; j--){
这是一个循环。
self.moveBy(0,j);
self.moveBy(j,0);
self.moveBy(0,-j);
self.moveBy(-j,0);
窗口分别向下,左,上,右移动j个像素,产生震动的效果。


  ///pc/homepage/javascript/sample/img/blank.gif" width="1" height="1">  
 

 

网页制作 网页设计 网站建设 网站设计 网站制作 做网站 做网页