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



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

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

var index = 7
定义一个变量。
link = new Array(6);
text = new Array(6);
link[0] ='sample.htm'
link[1] ='sample.htm'
link[2] ='sample.htm'
link[3] ='sample.htm'
link[4] ='sample.htm'
link[5] ='sample.htm'
link[6] ='sample.htm'
text[0] ='菜单一'
text[1] ='菜单一'
text[2] ='菜单一'
text[3] ='菜单一'
text[4] ='菜单一'
text[5] ='菜单一'
text[6] ='菜单一'
定义两个数组,及数组元素的内容。link数组为菜单所要链接的内容。text数组为菜单内容。
document.write ("<marquee scrollamount ='1' scrolldelay='100' direction= 'up' width='150' height='150'>");
这句话主要用到的是HTML语言中的<marquee> 标签的属性,scrolldelay属性表示菜单滚动速度,direction表示菜单滚动方向,可以有up,dowm,left,right。
for (i=0;i<index;i++){ document.write ("<img src='img/little.gif' width='12' height='12'> 
<a href="+link[i]+"target='_blank'>");
document.write (text[i] + "</A><br>");}
document.write ("</marquee>")
循环显示输出菜单。


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

 

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