国产探花免费观看_亚洲丰满少妇自慰呻吟_97日韩有码在线_资源在线日韩欧美_一区二区精品毛片,辰东完美世界有声小说,欢乐颂第一季,yy玄幻小说排行榜完本

首頁 > 學院 > 開發設計 > 正文

WEB頁面實現淡入淡出菜單

2019-11-18 21:38:04
字體:
來源:轉載
供稿:網友
(本文適合菜級網頁制作者或初級WEB編程者閱讀參考)
下面的程序還是簡單的測試版。需要編程的整個思路和具體分析步驟的請Email到i-key@263.net。

<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=gb2312">
<title> 淡入淡出菜單演示 </title>
<style>
.sml_menu {font-size: 9pt; color: white; cursor: hand; font-family: Tahoma;}
.font3 {font-size: 10.5pt; color: 147e19; font-family: Courier New;}
.menuitem {font-size: 10.5pt; color: white; cursor: default; font-family: Courier New;}
</style>
<script language="javascript">
//LiveMenu Ver1.0 by Key@CyberStudion.NPU
//2000.11
var intDelay=50; //設置菜單顯示速度,越大越慢,不超過100為好
var intInterval=5; //每次更改的透明度,最好小于10
//以下代碼需要改的地方可以更改
function MenuClick()
{
if (LayerMenu.style.display=="")
{
LayerMenu.style.display="none"; //當菜單顯示的時候單擊就關閉菜單
}
else{
LayerMenu.filters.alpha.opacity=0;
LayerMenu.style.display="";
GradientShow(); //淡入
  }
}

function GradientShow() //實現淡入的函數
{
LayerMenu.filters.alpha.opacity+=intInterval;
if (LayerMenu.filters.alpha.opacity<100) setTimeout("GradientShow()",intDelay);
}

function GradientClose() //實現淡出的函數
{
LayerMenu.filters.alpha.opacity-=intInterval;
if (LayerMenu.filters.alpha.opacity>0) {
  setTimeout("GradientClose()",intDelay);
  }
else {
  LayerMenu.style.display="none"; //當看不到菜單層后還需要把這個層隱藏起來
  }
}

function ChangeBG() //改變菜單項的背景顏色,這里的兩種顏色值可以改為你需要的
{
oEl=event.srcElement;
if (oEl.style.background!="navy") {
  oEl.style.background="navy";
  }
  else {
  oEl.style.background="#147e19";
  }
}

function ItemClick() //在菜單項上單擊后打開相應鏈接
{
oEl=event.srcElement;
oLink=oEl.all.tags( "A" );
if( oLink.length )
{
oLink[0].click();
GradientClose();
}
}
</script>
</head>
<body onMouSEOver="GradientClose();">
<br>
<p align=center class=font3>LiveMenu V1.0 by Key@CyberStudio.NPU<br>請查看源代碼<br>
請手動設置菜單層或菜單提示層的具體位置<br>
在: style="Position:Absolute;Left:???px;Top:???px;" 處設置</p>
<!--菜單提示層開始-->
<div style="Position:Absolute;Left:250px;Top:120px;" onClick="MenuClick()">
<table border=0 cellpadding=0 cellspacing=0 width=300><tr><td bgcolor=#147e19 class=sml_menu height=20 onselectstart="return false;">&nbsp;Click here to show the menu ... (單擊顯示菜單)</td></tr></table>
</div>
<!--菜單提示層結束-->
</body>
<!--菜單層開始-->
<div id=LayerMenu style="Position:Absolute;Left:250px;Top:137px;Display:none;filter:alpha(opacity=0);" oncontextmenu="return false" onMouseover="window.event.cancelBubble = true;">
<!--上面一行的onMouseover事件是很關鍵的-->
<table border=0 cellpadding=0 cellspacing=0 bgcolor=147e19>
<tr><td height=1 bgcolor=#f0f0f0 colspan=2></td></tr>
<tr><td width=20 valign=bottom bgcolor=navy></td>
<td>
<table border=0 width=200 cellpadding=0 cellspacing=0 onselectstart="return false;" onclick="ItemClick();" onMouseover="ChangeBG();" onMouseout="ChangeBG();">
  <tr><td class=menuitem height=20 style="background: 147e19;"><a href=/First></a>1.The First Menu Item</td></tr>
  <tr><td class=menuitem height=20 style="background: 147e19;"><a href=/Second></a>2.The Second Menu Item</td></tr>
  <tr><td class=menuitem height=20 style="background: 147e19;">3.The Third Menu Item</td></tr>
  <tr><td class=menuitem height=20 style="background: 147e19;">4.The Fourth Menu Item</td></tr>
</table>
</td></tr>
</table>
</div>
<!--菜單層結束-->
</html>

【本文版權歸作者與奧索網共同擁有,如需轉載,請注明作者及出處】    

發表評論 共有條評論
用戶名: 密碼:
驗證碼: 匿名發表
主站蜘蛛池模板: 宁陵县| 连平县| 清丰县| 广灵县| 榕江县| 肥东县| 西城区| 临武县| 朔州市| 兴隆县| 大同市| 焦作市| 灵宝市| 乌拉特中旗| 南投县| 固阳县| 无锡市| 定南县| 桂平市| 云和县| 洪雅县| 乐平市| 原平市| 轮台县| 平乡县| 池州市| 博乐市| 皮山县| 永州市| 呼伦贝尔市| 梁平县| 武鸣县| 衡阳市| 黄梅县| 庄浪县| 阿拉尔市| 涡阳县| 康保县| 叶城县| 阿拉善右旗| 长泰县|