2006-11-10

推荐几个入门级的JS特效代码

来源: 天极网 作者:佚名 评论 0 条
 

5、一个很Cool的JS菜单效果

<script>
function CoolMenuControl(){

//-----常规变量---
this.lastScrollX=0;
this.lastScrollY=0;
this.lastScrollW=0;
this.lastScrollH=0;
this.td_X=0;
this.td_Y=0;
this.td_W=0;
this.td_H=0;
this.td=0;
this.mouseon=0;
this.current=null
this.hk_name;
this.hktable_name;
this.menudiv_name;
this.menutable_name;
this.ml=0;
this.menuarray=new Array();
this.speed;
this.href="";

//-----菜单项目---
function menuitem(type,value,url,target){
this.type=type
this.value=value
this.url=url
this.target=target
}

//-----插入菜单---
this.insertmenu=function(type,value,url,target){
this.menuarray[this.menuarray.length]=new menuitem(type,value,url,target)
}

//-----程序初试化---
this.init=function(name,bdc,bgc,speed,Alpha){
var inhtml=""
var cellcount=0
var lastcellcount=0
this.hk_name=name "hk"
this.hktable_name=name "hktable"
this.menudiv_name=name "menudiv"
this.menutable_name=name "menutable"
this.speed=speed

for (i=0;i<this.menuarray.length;i )
{
if (this.menuarray[i].type=="2") cellcount=cellcount 1
if (this.menuarray[i].type=="1" || this.menuarray[i].type=="0") {cellcount=0}
if (lastcellcount<cellcount) {lastcellcount }

}

//alert(cellcount)

stylecode="cursor:hand;filter:Alpha(style=0,opacity=" Alpha ");background-color:" bgc

suspendcode="<DIV id=" this.hk_name " style='POSITION:absolute;' onclick='" name ".doClick()'>"
"<table id=" this.hktable_name " border='1' width='0' cellspacing='0' style='border-collapse: collapse' bordercolor='" bdc "'>"
"<tr><td height='18' style='" stylecode "'></td></tr></table></div>";
document.write(suspendcode);
var fcell=true
for (i=0;i<this.menuarray.length;i )
{
switch(this.menuarray[i].type)
{
case "0":
t=cellcount*2
if (t<=0)
{
inhtml ='<tr><td colspan=2 class=ht onmouseover='' name '.href="' this.menuarray[i].url ',' this.menuarray[i].target '"'>' this.menuarray[i].value
}
else
{
inhtml ='<tr><td colspan=' t ' class=ht onmouseover='' name '.href="' this.menuarray[i].url ',' this.menuarray[i].target '"'>' this.menuarray[i].value
}
fcell=true
break;
case "1":
t=(cellcount-1)*2
if (t<=0)
{
inhtml ='<tr><td width=6><td onmouseover='' name '.href="' this.menuarray[i].url ',' this.menuarray[i].target '"'>' this.menuarray[i].value
}
else
{
inhtml ='<tr><td width=6><td colspan=' t ' onmouseover='' name '.href="' this.menuarray[i].url ',' this.menuarray[i].target '"'>' this.menuarray[i].value
共20页: 上一页 [1] [2] 3 [4] [5] [6] [7] [8] [9] [10] [11] [12] [13] [14] [15] [16] [17] [18] [19] [20] 下一页

(本文仅表明作者个人观点,不代表本站及其管理员立场.) 推荐 收藏 投稿 打印 返回 关闭
上一篇:Html 书签的使用  
下一篇:DHTML实现可控制的页面内滚动区域
    评论加载中…

网站首页  -  网站地图 -   站长论坛  -  网站投稿  -    -  网站管理
Copyright © 2008 芜湖站长站 All Rights Reserved 皖ICP备07500611号