公告板
 2007-01-18網址變更,請使用新網址瀏覽網站。http://blog.nnickk.com/
 2007-01-17有任何問題歡迎到留言板留言!
 廣告一則電腦桌椅專賣店,另有辦公桌椅、家具、寢具等您來挑...

一個JS選單效果

attachments/month_0602/62006237822.jpg

第一步:實體化X-Menu
用法:
var <實體變量>.new CoolMenuControl()

第二步:建立選單項目---

用法:
<實體變量>.insertmenu(類型,Html程式碼,連接網址,目標)
 類型:0代表選單標題,1代表樹狀選單子項目,2代表橫向選單子項目
 Html程式碼:顯示在選單上的Html程式碼
連接網址:不用多說了,網址或Javascript腳本
目標:默認為空,即不在本頁打開;"_blank"代表在新的頁面打開
 例如:
CoolMenu2.insertmenu("2"," 新浪網","http://www.sina.com.cn/","_blank")  

第三步:建立選單---

用法:
<實體變量>.init(實體變量名,邊框顏色,背景顏色,滑動速度,背景半透明度)
'實體變量名'必須與<實體變量>相同
如果背景颜色="transparent"即為完全透明
 例如:
CoolMenu1.init("CoolMenu1","#002000","#38FFff",0.1,15)  


完整程式碼如下:
CODE:


<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=&#34;&#34;;



//-----選單項目---

function menuitem(type,value,url,target){

this.type=type

this.value=value

this.url=url

this.target=target

}



//-----插入選單---

this.ins&#101;rtmenu=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=&#34;&#34;

var cellcount=0

var lastcellcount=0

this.hk_name=name+&#34;hk&#34;

this.hktable_name=name+&#34;hktable&#34;

this.menudiv_name=name+&#34;menudiv&#34;

this.menutable_name=name+&#34;menutable&#34;

this.speed=speed



for (i=0;i<this.menuarray.length;i++)

  {

   if (this.menuarray[i].type==&#34;2&#34;) cellcount=cellcount+1

   if (this.menuarray[i].type==&#34;1&#34; || this.menuarray[i].type==&#34;0&#34;) {cellcount=0}

   if (lastcellcount<cellcount) {lastcellcount++}

       

  }



//alert(cellcount)





stylecode=&#34;cursor:hand;filter:Alpha(style=0,opacity=&#34;+Alpha+&#34;);background-color:&#34;+bgc



suspendcode=&#34;<DIV id=&#34;+this.hk_name+&#34; style='POSITION:absolute;' onclick='&#34;+name+&#34;.doClick()'>&#34;

            +&#34;<table id=&#34;+this.hktable_name+&#34; border='1' width='0' cellspacing='0' style='border-collapse: collapse' bordercolor='&#34;+bdc+&#34;'>&#34;

             +&#34;<tr><td height='18' style='&#34;+stylecode+&#34;'></td></tr></table></div>&#34;;

document.write(suspendcode);

var fcell=true

for (i=0;i<this.menuarray.length;i++)

{

  switch(this.menuarray[i].type)

   {

   case &#34;0&#34;:

   t=cellcount*2

   if (t<=0)

   {

   inhtml+='<tr><td colspan=2 class=ht onmouseover=''+name+'.href=&#34;'+this.menuarray[i].url+','+this.menuarray[i].target+'&#34;'>'+this.menuarray[i].value

   }

   else

   {

   inhtml+='<tr><td colspan='+t+' class=ht onmouseover=''+name+'.href=&#34;'+this.menuarray[i].url+','+this.menuarray[i].target+'&#34;'>'+this.menuarray[i].value

   }

   fcell=true

   break;

   case &#34;1&#34;:

   t=(cellcount-1)*2

    if (t<=0)

   {

   inhtml+='<tr><td width=6><td onmouseover=''+name+'.href=&#34;'+this.menuarray[i].url+','+this.menuarray[i].target+'&#34;'>'+this.menuarray[i].value

   }

   else

   {

   inhtml+='<tr><td width=6><td colspan='+t+' onmouseover=''+name+'.href=&#34;'+this.menuarray[i].url+','+this.menuarray[i].target+'&#34;'>'+this.menuarray[i].value

   }

   fcell=true

   break;

   

   case &#34;2&#34;:

   if (fcell)

    {

     inhtml+='<tr><td width=6><td onmouseover=''+name+'.href=&#34;'+this.menuarray[i].url+','+this.menuarray[i].target+'&#34;'>'+this.menuarray[i].value;

     fcell=false

    }

   else

    {

     inhtml+='<td width=6><td onmouseover=''+name+'.href=&#34;'+this.menuarray[i].url+','+this.menuarray[i].target+'&#34;'>'+this.menuarray[i].value;

    }

   break;

   }

}

inhtml='<div id='+this.menudiv_name+' onmousemove=&#34;'+name+'.doOver()&#34;>'

        +'<table id='+this.menutable_name+' border=&#34;0&#34; cellpadding=&#34;2&#34; class=&#34;menu&#34; cellspacing=&#34;4&#34;>'

        +inhtml

        +'</table></div>';

//alert(inhtml)

document.write(inhtml);



this.lastScrollX=0;

this.lastScrollY=-4;

this.posXY(eval(this.menutable_name).cells[0])

this.td_W=eval(this.menutable_name).cells[0].scrollWidth+6

this.td_H=eval(this.menutable_name).cells[0].scrollHeight

setInterval(name+&#34;.scrollback()&#34;,1)

}



//-----選單超連結---

this.doClick=function(){

//alert(this.url)

var url=this.href.split(&#34;,&#34;)

//alert(url[0])

//alert(url[1])

if (url[0]==&#34;&#34;) return



if (url[1]==&#34;_blank&#34;)

    {window.open(url[0])}

else

    {location.href=url[0]}

}



//-----滑動處理---

this.scrollback=function(){

diffX=this.td_X-3

diffY=this.td_Y-5

diffW=this.td_W

diffH=this.td_H

percentX=this.speed*(diffX-this.lastScrollX);

percentY=this.speed*(diffY-this.lastScrollY);

percentW=this.speed*(diffW-this.lastScrollW);

percentH=this.speed*(diffH-this.lastScrollH);



if(percentX>0)percentX=Math.ceil(percentX);

else percentX=Math.floor(percentX);

if(percentY>0)percentY=Math.ceil(percentY);

else percentY=Math.floor(percentY);

if(percentW>0)percentW=Math.ceil(percentW);

else percentW=Math.floor(percentW);

if(percentH>0)percentH=Math.ceil(percentH);

else percentH=Math.floor(percentH);



eval(this.hk_name).style.pixelTop+=percentY;

eval(this.hk_name).style.pixelLeft+=percentX;

eval(this.hktable_name).style.pixelWidth+=percentW;

eval(this.hktable_name).style.pixelHeight+=percentH;



this.lastScrollX=this.lastScrollX+percentX;

this.lastScrollY=this.lastScrollY+percentY;

this.lastScrollW=this.lastScrollW+percentW;

this.lastScrollH=this.lastScrollH+percentH;

}



//-----滑出---

this.doOver=function() {

      if (event.srcElement.tagName==&#34;TD&#34;) {

      if (event.srcElement.innerText.length==0 || event.srcElement.innerText==&#34;|&#34;) return

      this.posXY(event.srcElement)

      this.td_W=event.srcElement.scrollWidth+6  

      this.td_H=event.srcElement.scrollHeight

        }

}



//-----絕對定位---

this.posXY=function(obj){

    hk_left=obj.offsetLeft

    hk_top=obj.offsetTop

    vParent = obj.offsetParent;

      

    while (vParent.tagName.toUpperCase() != &#34;BODY&#34;)

       {

        hk_left += vParent.offsetLeft;

        hk_top += vParent.offsetTop;

        vParent = vParent.offsetParent;

       }

      

    this.td_X=hk_left

    this.td_Y=hk_top

}



//-----關於---

this.about=function(){

alert(&#34;OK&#34;)

}



}

</script>



<head>

<meta http-equiv=&#34;Content-Language&#34; content=&#34;zh-cn&#34;>

<style>

.b{color=#000066;cursor:hand}

.menu {

font-family:Arial;

cursor:Default;

font-size:12px;

border:1px #000000 solid;

border-collapse: collapse;

filter:progid:DXImageTransform.Microsoft.Gradient(gradienttype=0, startcolorstr=#ffffff, endcolorstr=#dddddd)

       progid:DXImageTransform.Microsoft.Shadow(direction=135,color=#cccccc,strength=3);

}

.ht{

font-weight:bold

}

</style>

<!--

第一步:實體化X-Menu類

   用法:

   var <實體變量>.new CoolMenuControl()

--->

<script language=&#34;javascript&#34;>

var CoolMenu1=new CoolMenuControl()

var CoolMenu2=new CoolMenuControl()

var CoolMenu3=new CoolMenuControl()



var about=new Array()

about[0]=&#34;關於X-Menu選單

Author:PuterJam
Copyright 2004
轉載請通知本人&#34;

about[1]=&#34;關於作者

&#34;這傢伙很懶,什麼也沒留下!!&#34;
不歡迎大家和我交流Javascript
QQ:10644570
E-Mail:PuterJam@etang.com&#34;



</script>

</head>

<body>

<!--

第二步:建立選單項目---

  

  用法:

   <實體變量>.ins&#101;rtmenu(類型,Html程式碼,連接網址,目標)

 類型:0代表選單標題,1代表樹狀選單子項目,2代表橫向選單子項目

 Html程式碼:顯示在選單上的Html程式碼

    連接網址:不用多說了,網址或Javascript腳本

    目標:默認為空,即不在本頁打開;&#34;_blank&#34;代表在新的頁面打開

 例如:     

    CoolMenu2.ins&#101;rtmenu(&#34;2&#34;,&#34;<img src=http://www.blueidea.com/img/icon/arrow.gif> 新浪網&#34;,&#34;http://www.sina.com.cn/&#34;,&#34;_blank&#34;)   

-->

<script>

CoolMenu1.ins&#101;rtmenu(&#34;0&#34;,&#34;歡迎使用X-Menu (選單範例)
  <font style='font-weight:lighter;'>Made By PuterJam</font>&#34;,&#34;&#34;,&#34;&#34;)

CoolMenu1.ins&#101;rtmenu(&#34;0&#34;,&#34; &#34;,&#34;http://www.blueidea.com/&#34;,&#34;_blank&#34;)



CoolMenu2.ins&#101;rtmenu(&#34;0&#34;,&#34;<img src=http://bbs.dvbbs.net/Skins/Default/nofollow.gif> 橫向選單&#34;,&#34;&#34;,&#34;&#34;)

CoolMenu2.ins&#101;rtmenu(&#34;2&#34;,&#34;<img src=http://www.blueidea.com/img/icon/arrow.gif> 新浪網&#34;,&#34;http://www.sina.com.cn/&#34;,&#34;_blank&#34;)

CoolMenu2.ins&#101;rtmenu(&#34;2&#34;,&#34;<img src=http://www.blueidea.com/img/icon/arrow.gif> 我的雅虎&#34;,&#34;http://cn.yahoo.com/&#34;,&#34;_blank&#34;)

CoolMenu2.ins&#101;rtmenu(&#34;2&#34;,&#34;<img src=http://www.blueidea.com/img/icon/arrow.gif> 亿唐&#34;,&#34;http://www.etang.com/&#34;,&#34;_blank&#34;)

CoolMenu2.ins&#101;rtmenu(&#34;2&#34;,&#34;<img src=http://www.blueidea.com/img/icon/arrow.gif> 21世紀&#34;,&#34;http://www.21cn.com/&#34;,&#34;_blank&#34;)

CoolMenu2.ins&#101;rtmenu(&#34;2&#34;,&#34;<img src=http://www.blueidea.com/img/icon/arrow.gif> 遊俠網&#34;,&#34;http://www.ali213.net/&#34;,&#34;_blank&#34;)



CoolMenu3.ins&#101;rtmenu(&#34;0&#34;,&#34;<img src=http://bbs.dvbbs.net/Skins/Default/nofollow.gif> 樹狀選單&#34;,&#34;&#34;,&#34;&#34;)

CoolMenu3.ins&#101;rtmenu(&#34;0&#34;,&#34;<img src=http://www.blueidea.com/img/common/logo.gif> &#34;,&#34;http://www.blueidea.com/&#34;,&#34;_blank&#34;)

CoolMenu3.ins&#101;rtmenu(&#34;1&#34;,&#34;關於X-Menu選單&#34;,&#34;javascript:alert(about[0])&#34;,&#34;&#34;)

CoolMenu3.ins&#101;rtmenu(&#34;1&#34;,&#34;關於作者&#34;,&#34;javascript:alert(about[1])&#34;,&#34;&#34;)

CoolMenu3.ins&#101;rtmenu(&#34;1&#34;,&#34;聯絡我&#34;,&#34;mailto:PuterJam@etang.com&#34;,&#34;&#34;)

CoolMenu3.ins&#101;rtmenu(&#34;1&#34;,&#34;你的瀏覽器版本&#34;,&#34;javascript:alert(navigator.appName)&#34;,&#34;&#34;)

</script>



<!--

第三步:建立選單---

  

  用法:

    <實體變量>.init(實體變量名,邊框顏色,背景顏色,滑動速度,背景半透明度)

       '實體變量名'必須與<實體變量>相同

       如果背景颜色=&#34;transparent&#34;即為完全透明

 例如:     

    CoolMenu1.init(&#34;CoolMenu1&#34;,&#34;#002000&#34;,&#34;#38FFff&#34;,0.1,15)   

-->

<script>CoolMenu1.init(&#34;CoolMenu1&#34;,&#34;#002000&#34;,&#34;#38FFff&#34;,0.1,15)</script>

<script>CoolMenu2.init(&#34;CoolMenu2&#34;,&#34;#002000&#34;,&#34;#00FF80&#34;,0.2,10)</script>

<script>CoolMenu3.init(&#34;CoolMenu3&#34;,&#34;#002000&#34;,&#34;#f0FF00&#34;,0.3,25)</script>

</body>





<a href="http://www.blueidea.com/bbs/newsdetail.asp?id=1491981&page=1&posts=&Daysprune=&lp=1" target="_blank">資料來源</a>



另外一種
attachments/month_0602/l20062371121.jpg

CODE:


<html>

<head>

<title>Link Style01 - Cocoon Studio</title>

<SCRIPT LANGUAGE=&#34;JavaScript&#34;>

    CocoonStudio = function(){}

    CocoonStudio.DHtml = function(){}

    CocoonStudio.DHtml.LinkStyle01 = function(){}

    CocoonStudio.DHtml.LinkStyle01.TemplteDiv = document.cr&#101;ateElement(&#34;DIV&#34;);

    with(CocoonStudio.DHtml.LinkStyle01.TemplteDiv){

        with(style){

            position = &#34;absolute&#34;; display = &#34;none&#34;; width = height = 0;

            backgroundColor = &#34;#80FF00&#34;; border = &#34;1px solid #008000&#34;; cursor = &#34;hand&#34;;

            filter = &#34;progid:DXImageTransform.Microsoft.Alpha(style=3,opacity=0,finishOpacity=0) BlendTrans(duration=1);&#34;;

        }

    }

    CocoonStudio.DHtml.LinkStyle01.ActionCount = 10;

    CocoonStudio.DHtml.LinkStyle01.SizeStep = 4;

    CocoonStudio.DHtml.LinkStyle01.FadeStep = 10;

    CocoonStudio.DHtml.LinkStyle01.Timer = new Array();

    CocoonStudio.DHtml.LinkStyle01.Items = new Array();



    CocoonStudio.DHtml.LinkStyle01.Initial = function(){

        document.body.ins&#101;rtAdjacentElement(&#34;beforeEnd&#34;,CocoonStudio.DHtml.LinkStyle01.TemplteDiv);    

    }



    CocoonStudio.DHtml.LinkStyle01.MouseOver = function(){

        var o;

        var iAddSize = this.ActionCount * this.SizeStep * 2;

        var oSrc = event.srcElement;

        var c = oSrc.sourceIndex;

        with(o=CocoonStudio.DHtml.LinkStyle01.TemplteDiv.cloneNode(true)){

            with(style){

                display = ''; width = oSrc.scrollWidth + iAddSize; height = oSrc.scrollHeight + iAddSize;

                pixelTop = oSrc.offsetTop - iAddSize / 2; pixelLeft = oSrc.offsetLeft - iAddSize / 2;

            }

            onclick = oSrc.click;

            onmouseout = new Function(&#34;CocoonStudio.DHtml.LinkStyle01.FadeOut(&#34;+c+&#34;);&#34;);

        }

        CocoonStudio.DHtml.LinkStyle01.Items[c] = o;

        document.body.ins&#101;rtAdjacentElement(&#34;beforeEnd&#34;,o);

        this.FadeIn(c);

        setTimeout(&#34;CocoonStudio.DHtml.LinkStyle01.FadeOut(&#34;+c+&#34;);&#34; ,1500);

    }



    CocoonStudio.DHtml.LinkStyle01.FadeIn = function(c,n){

        if(!c) return; var p = n; if(!p) p = 0;

        var o = CocoonStudio.DHtml.LinkStyle01.Items[c]; if(!o) return;

        with(o){

            var iFade = filters[0].opacity;

            if(iFade<=(100-this.FadeStep)) filters[0].opacity += this.FadeStep;

            with(style){

                width = parseInt(width) - this.SizeStep*2; height = parseInt(height) - this.SizeStep*2;

                pixelTop += this.SizeStep; pixelLeft += this.SizeStep;

            }

        }

        if(p>=this.ActionCount-3) return;

        CocoonStudio.DHtml.LinkStyle01.Timer[c] = setTimeout(&#34;CocoonStudio.DHtml.LinkStyle01.FadeIn(&#34;+c+&#34;,&#34;+(++p)+&#34;);&#34;,50);

    }



    CocoonStudio.DHtml.LinkStyle01.FadeOut = function(c,n){

        if(!c) return; var p = n; if(!p) p = this.ActionCount-1;

        clearTimeout(CocoonStudio.DHtml.LinkStyle01.Timer[c]);

        var o = CocoonStudio.DHtml.LinkStyle01.Items[c]; if(!o) return;

        with(o){

            var iFade = filters[0].opacity;

            if(iFade>=this.FadeStep) filters[0].opacity -= this.FadeStep;

            with(style){

                width = parseInt(width) + this.SizeStep; height = parseInt(height) + this.SizeStep;

                pixelTop -= this.SizeStep/2; pixelLeft -= this.SizeStep/2;

            }

        }

        if(p<=1){ o.removeNode(true); p=0; return; }

        setTimeout(&#34;CocoonStudio.DHtml.LinkStyle01.FadeOut(&#34;+c+&#34;,&#34;+(--p)+&#34;);&#34;,25);

    }



    window.onload = CocoonStudio.DHtml.LinkStyle01.Initial;

</SCRIPT>

<script language=&#34;JavaScript&#34; event=&#34;onmousemove&#34; for=&#34;CcLS02Menu&#34;>

    CocoonStudio.DHtml.LinkStyle01.MouseOver();

</script>

<style>

body{

    font-size: 9pt;

}

</style>

</head>



<body>

             

    <a href=&#34;javascript:void(0);&#34; onclick=&#34;alert(innerText)&#34; onmouseover=&#34;CocoonStudio.DHtml.LinkStyle01.MouseOver()&#34;>Cocoon Studio</a>

       

    <a href=&#34;javascript:void(0);&#34; onclick=&#34;alert(innerText)&#34; onmouseover=&#34;CocoonStudio.DHtml.LinkStyle01.MouseOver()&#34;>Sunrise_Chen</a>

       

    <a href=&#34;javascript:void(0);&#34; onclick=&#34;alert(innerText)&#34; onmouseover=&#34;CocoonStudio.DHtml.LinkStyle01.MouseOver()&#34;>www.ccopus.com</a>

    <p>

             

    <a href=&#34;javascript:void(0);&#34; onclick=&#34;alert(innerText)&#34; onmouseover=&#34;CocoonStudio.DHtml.LinkStyle01.MouseOver()&#34;>Cocoon Asp Check</a>

       

    <a href=&#34;javascript:void(0);&#34; onclick=&#34;alert(innerText)&#34; onmouseover=&#34;CocoonStudio.DHtml.LinkStyle01.MouseOver()&#34;>Cocoon Counter 6</a>

       

    <a href=&#34;javascript:void(0);&#34; onclick=&#34;alert(innerText)&#34; onmouseover=&#34;CocoonStudio.DHtml.LinkStyle01.MouseOver()&#34;>Cocoon Disk Manager 4.5</a>

       

    <a href=&#34;javascript:void(0);&#34; onclick=&#34;alert(innerText)&#34; onmouseover=&#34;CocoonStudio.DHtml.LinkStyle01.MouseOver()&#34;>Cocoon MS-Access DbAdmin 1.0</a>

</body>

</html>



還有一種

attachments/month_0602/z2006237155.jpg

CODE:


<html>

<head>

<title>Link Style02 - Cocoon Studio</title>

<SCRIPT LANGUAGE=&#34;JavaScript&#34;>

    CocoonStudio = function(){/* Published by Cocoon Studio. Url: www.ccopus.com */}

    CocoonStudio.DHtml = function(){/* Author: Sunrise_Chen Email: sunrise_chen@msn.com */}

    CocoonStudio.DHtml.LinkStyle02 = function(){/* CocoonStudio连接特效02 */}

    CocoonStudio.DHtml.LinkStyle02.TemplteDiv = document.cr&#101;ateElement(&#34;DIV&#34;);

    CocoonStudio.DHtml.LinkStyle02.ActionCount = 8;

    CocoonStudio.DHtml.LinkStyle02.SizeStep = 4;

    CocoonStudio.DHtml.LinkStyle02.FadeStep = 5;

    CocoonStudio.DHtml.LinkStyle02.FadeMax = 25;

    CocoonStudio.DHtml.LinkStyle02.OffsetWidth = 16;

    CocoonStudio.DHtml.LinkStyle02.OffsetHeight = 8;

    CocoonStudio.DHtml.LinkStyle02.Timer = 0;

    CocoonStudio.DHtml.LinkStyle02.ToX = 0;

    CocoonStudio.DHtml.LinkStyle02.ToY = 0;

    CocoonStudio.DHtml.LinkStyle02.CurrentX = 0;

    CocoonStudio.DHtml.LinkStyle02.CurrentY = 0;

    CocoonStudio.DHtml.LinkStyle02.StepWidth = 0;

    CocoonStudio.DHtml.LinkStyle02.StepHeight = 0;

    CocoonStudio.DHtml.LinkStyle02.IsMoving = false;



    CocoonStudio.DHtml.LinkStyle02.Initial = function(){

        with(CocoonStudio.DHtml.LinkStyle02.TemplteDiv){

            with(style){

                position = &#34;absolute&#34;; width = height = left = top = 0; display = &#34;none&#34;;

                backgroundColor = &#34;#80FF00&#34;; border = &#34;1px solid #008000&#34;; cursor = &#34;hand&#34;;

                filter = &#34;progid:DXImageTransform.Microsoft.Alpha(style=0,opacity=0)&#34;;

                zIndex = -1;

            }

        }

        document.body.ins&#101;rtAdjacentElement(&#34;beforeEnd&#34;,CocoonStudio.DHtml.LinkStyle02.TemplteDiv);

    }



    CocoonStudio.DHtml.LinkStyle02.MouseOver = function(sender){

        with(CocoonStudio.DHtml.LinkStyle02){

            var iAddSize = this.ActionCount * this.SizeStep * 2;

            var oSrc = event.srcElement;

            var o = CocoonStudio.DHtml.LinkStyle02.TemplteDiv;

            this.CurrentX = o.offsetLeft; CurrentY = o.offsetTop;

            ToX = event.x + document.body.scrollLeft - event.offsetX - (OffsetWidth / 2);

            ToY = event.y + document.body.scrollTop - event.offsetY - (OffsetHeight / 2);

            //StepWidth = 0.08*(ToX - CurrentX)  ;

            //StepHeight = 0.08*(ToY - CurrentY) ;

            StepWidth = (ToX - CurrentX) / ActionCount ;

            StepHeight = (ToY - CurrentY) / ActionCount ;

            if(StepWidth>0) StepWidth = Math.ceil(StepWidth); else StepWidth = Math.floor(StepWidth);

            if(StepHeight>0) StepHeight = Math.ceil(StepHeight); else StepHeight = Math.floor(StepHeight);

            o.style.width = oSrc.scrollWidth + OffsetWidth;

            o.style.height = oSrc.scrollHeight + OffsetHeight;

            o.style.display = '';

            oSrc.onmouseout = MouseOut;

            //o.onmouseout = MouseOut;

            //o.onclick = oSrc.click;

            IsMoving = true;

            FadeIn();

        }

    }



    CocoonStudio.DHtml.LinkStyle02.MouseOut = function(){

        with(CocoonStudio.DHtml.LinkStyle02){

            if(IsMoving) return;

            IsMoving = true;

            FadeOut();

        }

    }



    CocoonStudio.DHtml.LinkStyle02.FadeIn = function(){

        with(CocoonStudio.DHtml.LinkStyle02){

            with(TemplteDiv){

                var iFade = filters[0].opacity;

                if(iFade<=(this.FadeMax-this.FadeStep)) filters[0].opacity += this.FadeStep;

                with(style){

                    pixelTop += this.StepHeight; pixelLeft += this.StepWidth;

                    if(Math.abs(pixelTop - this.ToY) <= Math.abs(this.StepHeight)) pixelTop = this.ToY;

                    if(Math.abs(pixelLeft - this.ToX) <= Math.abs(this.StepWidth)) pixelLeft = this.ToX;

                    if(pixelTop == this.ToY && pixelLeft == this.ToX && iFade >= this.FadeMax){

                        this.IsMoving = false;

                        return;

                    }

                }

            }

            clearTimeout(Timer); Timer = setTimeout(&#34;CocoonStudio.DHtml.LinkStyle02.FadeIn()&#34;, 25);

        }

    }



    CocoonStudio.DHtml.LinkStyle02.FadeOut = function(){

        with(CocoonStudio.DHtml.LinkStyle02){

            with(TemplteDiv){

                var iFade = filters[0].opacity;

                if(iFade>=FadeStep) filters[0].opacity -= FadeStep;

                else{

                    CocoonStudio.DHtml.LinkStyle02.IsMoving = false;

                    filters[0].opacity = 0; style.display='none';

                    return;

                }

            }

            clearTimeout(Timer); Timer = setTimeout(&#34;CocoonStudio.DHtml.LinkStyle02.FadeOut()&#34;,25);

        }

    }



    window.onload = CocoonStudio.DHtml.LinkStyle02.Initial;

</SCRIPT>

<script language=&#34;JavaScript&#34; event=&#34;onmouseover&#34; for=&#34;CcLS02Menu&#34;>

    CocoonStudio.DHtml.LinkStyle02.MouseOver(this);

</script>

<style>

body, td{

    font-size: 9pt;

}

td{cursor: hand;}

</style>

</head>



<body>

<TABLE cellpadding=0 cellspacing=10>

<TR>

    <TD id=&#34;CcLS02Menu&#34;><a href=&#34;http://club.pchome.net/forum.php?topic=19&#34;>PCHOME.net Club - ASP</a></TD>

    <TD><a href=&#34;http://www.ccopus.com&#34; id=&#34;CcLS02Menu&#34;>Our Cocoon Studio</a></TD>

</TR>

<TR>

    <TD id=&#34;CcLS02Menu&#34;>Sunrise_Chen</TD>

    <TD id=&#34;CcLS02Menu&#34; onclick=&#34;alert('我的工作室')&#34;>Cocoon Studio</TD>

</TR>

<TR>

    <TD id=&#34;CcLS02Menu&#34;>Cocoon Counter 6</TD>

    <TD id=&#34;CcLS02Menu&#34;>Cocoon asp 探针</TD>

</TR>

<TR>

    <TD id=&#34;CcLS02Menu&#34;>PCHOME.net Club - ASP</TD>

    <TD id=&#34;CcLS02Menu&#34; id=&#34;CcLS02Menu&#34;></TD>

</TR>

<TR>

    <TD id=&#34;CcLS02Menu&#34;>

        这是一个单元格

    </TD>

    <TD>

        <a id=&#34;CcLS02Menu&#34; href=&#34;javascript:alert('Welcome to our Cocoon Studio');&#34;>这是一个连接</a>

    </TD>

</TR>

<TR>

    <TD><div id=&#34;CcLS02Menu&#34;>这是一个DIV</div></TD>

    <TD><STRONG id=&#34;CcLS02Menu&#34;>这是一个STRONG标签</STRONG></TD>

</TR>

</TABLE>

<div style=&#34;position:absolute;top:200;left:200;width:200;text-align:center;cursor:hand;border:1px solid gray&#34; id=&#34;CcLS02Menu&#34;>这是一个浮动的层</div>

</body>





</html>



資料來源
引用通告地址: 點擊獲取引用地址
評論: 0 | 引用: 0 | 閱讀: 1229 | 列印 | 文件 | 轉發
 收入網摘
發表評論
暱 稱: 密 碼:
網 址: E - mail:
驗證碼: 驗證碼圖片 選 項:
頭 像:
內 容: