效果酷似flash的css+div+js功能表

來源:互聯網
上載者:User
關鍵字 網頁製作 Ajax JavaScript

<html>
<head>
<meta HTTP-equiv="Content-Type" content="text/html; charset=gb2312" />
<title>效果酷似flash的css+div+js功能表</title>
<style>
body{
background-color:#B8B8A0;
}
#fbtn{
display:none;
overflow:hidden;
border-style:solid;
border-width:1px;
border-color:#e1e1c9 #e1e1c9 #6e6e56 #6e6e56;
padding:1 1 1 1;
width:115px;
height:30px;
}
#fbtn_txt{
position:relative;
}
#fbtn_txt div{
height:30px;
padding-top:11px;
font-size:9px;
font-family:small fonts;
color:#800080;
text-align:center;
cursor:hand;
}
#fbtn_mask{
background-color:#ffffff;
position:relative;
width:100%;
height:100%;
}
</style>

</head>

<body>
<div id=fbtn>
 <div id=fbtn_mask></div>
 <div id=fbtn_txt >
 <div>G1</div>
 <div>good morning</div>
 </div>
</div>
<div id=fbtn>
 <div id=fbtn_mask></div>
 <div id=fbtn_txt >
 <div>G2</div>
 <div>good evening</div>
 </div>
</div>
<div id=fbtn>
 <div id=fbtn_mask></div>
 <div id=fbtn_txt >
 <div>M1</div>
 <div>my name is fireyy</div>
 </div>
</div>
<div id=fbtn>
 <div id=fbtn_mask></div>
 <div id=fbtn_ txt>
 <div>M2</div>
 <div>mm mm i love u</div>
 </div>
</div>
<div id=fbtn>
 <div id=fbtn_mask></div>
 <div id=fbtn_txt>
 <div>G1</div>
 <div>good morning</div >
 </div>
</div>
<div id=fbtn>
 <div id=fbtn_mask></div>
 <div id=fbtn_txt>
 <div>G2</div>
 <div>good evening</div >
 </div>
</div>
<div id=fbtn>
 <div id=fbtn_mask></div>
 <div id=fbtn_txt>
 <div>M1</div>
 <div>my name is fireyy</div >
 </div>
</div>
<div id=fbtn>
 <div id=fbtn_mask></div>
 <div id=fbtn_txt>
 <div>M2</div>
 <div>mm mm i love u</div>
 </div>
</div>

<script>
var current=null;
var t=null;
for(var i=0;i<fbtn.length;i++){
 fbtn_txt[i]. style.posTop=-30;
 fbtn_mask[i].style.posTop=-30;
 fbtn[i].index=i;
 fbtn[i].style.display="block";
 fbtn[i].onmouseover=function(){
 if(!current){
 current=this;
 domove( this.index);
 }
 else if(current!=this){
 domove(current.index);
 domove(this.index);
 current =this;
 }
 }
 fbtn[i].onmouseout=function(){
 if(event.toElement==this.parentElement&t==this){
 domove(this.index);
 current=null;
 }
 }
 }
function domove(num){
 var o=fbtn_txt[num];
 var m=fbtn_mask[num];
 if(o.style.posTop <-60){
 o.style.display="none";
 var t=o.children[1].innerHTML;
 o.children[1]. innerHTML=o.children[0].innerHTML;
 o.children[0].innerHTML=t;
 o.style.posTop=-30;
 o.style.display="block";
 if(m.style.posTop>30)
 m.style.posTop=-30;
 else
 m.style.posTop=0;
 }
 else{
 m.style.posTop+=3;
 o.style.posTop-=3;
 setTimeout('domove('+ num+')',15);
 }
 }
</script>
</body>
</html>

相關文章

聯繫我們

該頁面正文內容均來源於網絡整理,並不代表阿里雲官方的觀點,該頁面所提到的產品和服務也與阿里云無關,如果該頁面內容對您造成了困擾,歡迎寫郵件給我們,收到郵件我們將在5個工作日內處理。

如果您發現本社區中有涉嫌抄襲的內容,歡迎發送郵件至: info-contact@alibabacloud.com 進行舉報並提供相關證據,工作人員會在 5 個工作天內聯絡您,一經查實,本站將立刻刪除涉嫌侵權內容。

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.