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

 

//www.shanghaigongsi.com.cn/pc/homepage/dreamweaver/dw0101.htm" onMouseOver="mover(0)" onMouseOut="mout(5)">dreamweaver

//www.shanghaigongsi.com.cn/pc/homepage/fireworks/firejq.htm" onMouseOver="mover(2)" onMouseOut="mout(5)">fireworks

//www.shanghaigongsi.com.cn/pc/homepage/flashsl/flashjq.htm" onMouseOver="mover(1)" onMouseOut="mout(5)">flash

//www.shanghaigongsi.com.cn/pc/oa/excel2k/ex2k0101.htm" onMouseOver="mover(3)" onMouseOut="mout(5)">excel

//www.shanghaigongsi.com.cn/pc/oa/word2k/wd2k0101.htm" onMouseOver="mover(4)" onMouseOut="mout(5)">word

想学什麽,就按下去吧!

 

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



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

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

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

messages=new Array(5)
messages[0]="这是一种很好的主页制做工具! "
messages[1]="它可以制做出很多意想不到的效果!"
messages[2]="它可以为你主页的图片增添光彩!"
messages[3]="它可以帮你做图表!"
messages[4]="它可以帮你处理文字!"
messages[5]="按下去,看看吧!"
定义一个数组,并列出其中元素的内容。
var browser;
声明一个变量。
if (document.all)
{ layerRef='document.all.'
styleRef='.style.'
changeMessages=".innerHTML=messages[num]"
closeit=""
browser=true }
如果浏览器是IE,定义各变量的值,以备后面的语句用。

else if (document.layers)
{ alert("此效果在Netscape浏览器中不能实现!");
}

如果浏览器是Netscape,弹出警告框。
function mover(num)
{ if(browser)
{ eval(layerRef+'startingMsg'
+changeMessages) eval(layerRef+'startingMsg'+closeit);
}
定义一个函数mover。
function mout(num)
{ if(browser)
{ eval(layerRef+'startingMsg'
+changeMessages);
eval(layerRef+'startingMsg'+closeit);
定义一个函数mout。
<a href="http://www.shanghaigongsi.com.cn/pc/
homepage/dreamweaver/dw0101.htm"
onMouseOver="mover(0)"
onMouseOut="mout(0)">dreamweaver</a>
鼠标在文字上的时候,调用mover函数。鼠标移开的时候,调用mout函数。
<a href="http://www.shanghaigongsi.com.cn/pc/
homepage/fireworks/firejq.htm"
onMouseOver="mover(2)"
onMouseOut="mout(2)">fireworks</a>
<a href="http://www.shanghaigongsi.com.cn/pc/
hoge/flash/fla101.htm"
onMouseOver="mover(1)"
onMouseOut="mout(1)">flash</a>
<a href="http://www.shanghaigongsi.com.cn/pc/
oa/excel2k/ex2k0101.htm"
onMouseOver="mover(3)"
onMouseOut="mout(3)">excel</a>
<a href="http://www.shanghaigongsi.com.cn/pc/
oa/word2k/wd2k0101.htm"
onMouseOver="mover(4)"
onMouseOut="mout(4)">word</a>
同上。

注:此效果只能在IE浏览器中实现。

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

 

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