最新国产好看的视频,伊人天堂AV在线,国产Aaaaaa视频,蜜臀视频在线观看一区,人妻av色图,密臀久久久精品影片,青青视频免费观看毛片,久草在线观看视,国产三级精品色情在线

js實現(xiàn)的二級橫向菜單條實例

 更新時間:2015年08月22日 15:23:23   作者:企鵝  
這篇文章主要介紹了js實現(xiàn)的二級橫向菜單條,是非常美觀簡潔的二級導航條效果,可實現(xiàn)針對鼠標事件的動態(tài)響應及頁面樣式切換功能,簡單實用,需要的朋友可以參考下

本文實例講述了js實現(xiàn)的二級橫向菜單條。分享給大家供大家參考。具體如下:

這是一款十分清新的多級網(wǎng)頁菜單,類似滑動門的操作風格,鼠標放上后,相應的二級菜單會顯示出來,我覺得挺漂亮的,適合許多網(wǎng)站使用,不相信么?點擊“運行代碼”看效果吧。

運行效果截圖如下:

在線演示地址如下:

http://demo.jb51.net/js/2015/js-2row-nav-menu-codes/

具體代碼如下:

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<TITLE>藍色二級橫向滑動導航菜單</TITLE>
<style type=text/css>
UL {
 LIST-STYLE-TYPE: none;
 padding:0px;
 margin:0px;
}
LI {
 FONT-SIZE: 12px;
 COLOR: #333;
 LINE-HEIGHT: 1.5em;
 FONT-FAMILY: "微軟雅黑", Arial, Verdana;
}
.hide {
 DISPLAY: none
}
#mainmenu_top UL LI .menuhover {
 BACKGROUND: url(images/mainmenu_s.gif) no-repeat;
 COLOR: #fff;
}
#mainmenu_top UL LI A {
 MARGIN-TOP: 2px;
 CURSOR: pointer;
 PADDING-TOP: 8px;
 HEIGHT: 20px;
 text-decoration: none;
}
#mainmenu_top {
 width:100%;
 HEIGHT: 28px;
 display:block;
 overflow:hidden;
}
#mainmenu_top UL LI {FLOAT: left}
#mainmenu_top UL LI A {
 WIDTH: 81px;
 height:auto;
 DISPLAY: block;
 COLOR: #666666;
 TEXT-ALIGN: center;
 BACKGROUND: url(images/mainmenu_h.gif) no-repeat;
}
#mainmenu_bottom {
 width:100%;
 height:32px;
 line-height:32px;
 display:block;
 overflow:hidden;
 BACKGROUND: url(images/mainmenu_bg.jpg) repeat-x
}
#mainmenu_bottom .mainmenu_rbg {
 HEIGHT: 32px;
 COLOR: #fff;
 MARGIN-LEFT: 0px;
 PADDING: 0px 0px 0px 5px;
 BACKGROUND: url(images/mainmenu_r.gif) no-repeat right 50%;
}
#mainmenu_bottom UL {}
#mainmenu_bottom UL LI {
 PADDING-LEFT: 8px;
 FLOAT: left;
 MARGIN-LEFT: 7px;
 HEIGHT: 32px;
}
#mainmenu_bottom UL LI.se {
 FLOAT: left;
 MARGIN-LEFT: 7px;
 HEIGHT: 32px;
 PADDING-LEFT: 8px;
 BACKGROUND: url(images/menulink_bg_l.gif) no-repeat;
}
#mainmenu_bottom UL LI A {
 COLOR: #fff;
 LINE-HEIGHT: 32px;
 PADDING-RIGHT: 18px;
 DISPLAY: block;
 text-decoration: none;
 BACKGROUND: url(images/menulink_bg_normal.gif) no-repeat right 50%;
}
#mainmenu_bottom UL LI A:hover {
 BACKGROUND: url(images/menulink_bg_normal.gif) no-repeat right 50%;
 color: #FFCC00;
}
#mainmenu_bottom UL LI A.se {
 COLOR: #fff;
 LINE-HEIGHT: 32px;
 PADDING-RIGHT: 18px;
 DISPLAY: block;
 BACKGROUND: url(images/menulink_bg_r.gif) no-repeat right 50%;
}
</style>
<SCRIPT type=text/javascript>
var waitting = 1;
var secondLeft = waitting;
var timer;
var sourceObj;
var number;
function getObject(objectId)//獲取id的函數(shù)
{
 if(document.getElementById && document.getElementById(objectId)) {
 // W3C DOM
 return document.getElementById(objectId);
 } else if (document.all && document.all(objectId)) {
 // MSIE 4 DOM
 return document.all(objectId);
 } else if (document.layers && document.layers[objectId]) {
 // NN 4 DOM.. note: this won't find nested layers
 return document.layers[objectId];
 } else {
 return false;
 }
}
function SetTimer()//主導航時間延遲的函數(shù)
{
 for(j=1; j <10; j++){
  if (j == number){
  if(getObject("mm"+j)!=false){
   getObject("mm"+ number).className = "menuhover";
   getObject("mb"+ number).className = "";
  }
  }
  else{
   if(getObject("mm"+j)!=false){
   getObject("mm"+ j).className = "";
   getObject("mb"+ j).className = "hide";
  }
  }
 }
}
function CheckTime()//設置時間延遲后
{
 secondLeft--;
 if ( secondLeft == 0 )
 {
 clearInterval(timer);
 SetTimer();
 }
}
function showM(thisobj,Num)//主導航鼠標滑過函數(shù),帶時間延遲
{
 number = Num;
 sourceObj = thisobj;
 secondLeft = 1;
 timer = setTimeout('CheckTime()',100);
}
function OnMouseLeft()//主導航鼠標移出函數(shù),清除時間函數(shù)
{
 clearInterval(timer);
 } 
function mmenuURL()//主導航、二級導航顯示函數(shù)
{
var thisURL = document.URL;
tmpUPage = thisURL.split( "/" );
thisUPage_s = tmpUPage[ tmpUPage.length-2 ];
thisUPage_s= thisUPage_s.toLowerCase();//小寫
 if(thisUPage_s=="#"||thisUPage_s=="#"||thisUPage_s=="#")
 {
  getObject("mm1").className="menuhover"
  getObject("mb1").className = "";
 }
 else if(thisUPage_s=="domain")
 {
  getObject("mm2").className="menuhover"
  getObject("mb2").className = "";
 }
 else if(thisUPage_s=="hosting")
 {
  getObject("mm3").className="menuhover"
  getObject("mb3").className = "";
 }
 else if(thisUPage_s=="mail")
 {
  getObject("mm4").className="menuhover"
  getObject("mb4").className = "";
 }
 else if(thisUPage_s=="solutions"||thisUPage_s=="site"){
  getObject("mm5").className="menuhover"
  getObject("mb5").className = "";
 }
 else if(thisUPage_s=="promotion"){
  getObject("mm6").className="menuhover"
  getObject("mb6").className = "";
 }
 else if(thisUPage_s=="trade"||thisUPage_s=="phonetic"||thisUPage_s=="switchboard"||thisUPage_s=="note"){
  getObject("mm7").className="menuhover"
  getObject("mb7").className = "";
 }
 else if(thisUPage_s=="benefit"){
  getObject("mm8").className="menuhover"
  getObject("mb8").className = "";
 }
 else if(thisUPage_s=="userlogon"||thisUPage_s=="domain_service"||thisUPage_s=="hosting_service"||thisUPage_s=="mail_service"||thisUPage_s=="Payed"||thisUPage_s=="unPayed"||thisUPage_s=="Invoice"||thisUPage_s=="Finance"||thisUPage_s=="RegInfoModify"){
  getObject("mm9").className="menuhover"
  getObject("mb9").className = "";
 }
 else
 {
  getObject("mm1").className="";
  getObject("mb1").className = "";
 }
}
window.load=mmenuURL()
</SCRIPT>
<!--導航開始-->
<DIV id=mainmenu_body>
<!--主導航開始-->
 <DIV id=mainmenu_top>
 <UL>
 <LI><A id=mm1 onmouseover=showM(this,1); onmouseout=OnMouseLeft(); href="#" target=_parent>網(wǎng)站首頁</A> </LI>
 <LI><A id=mm2 onmouseover=showM(this,2); onmouseout=OnMouseLeft(); href="#" target=_parent>JS代碼</A> </LI>
 <LI><A id=mm3 onmouseover=showM(this,3); onmouseout=OnMouseLeft(); href="#" target=_parent>電子商務</A> </LI>
 <LI><A id=mm4 onmouseover=showM(this,4); onmouseout=OnMouseLeft(); href="#" target=_parent>腳本下載</A> </LI>
 <LI><A id=mm5 onmouseover=showM(this,5); onmouseout=OnMouseLeft(); href="#" target=_parent>建站技巧</A> </LI>
 <LI><A id=mm6 onmouseover=showM(this,6); onmouseout=OnMouseLeft(); href="#" target=_parent>CSS技巧</A> </LI>
 <LI><A id=mm7 onmouseover=showM(this,7); onmouseout=OnMouseLeft(); href="#" target=_parent>CSS導航菜單</A> </LI>
 <LI style="DISPLAY: none"><A id=mm8 onmouseover=showM(this,8); onmouseout=OnMouseLeft(); href="#" target=_parent>菜單特效</A> </LI>
 <LI><A id=mm9 onmouseover=showM(this,9); onmouseout=OnMouseLeft(); href="#" target=_parent>SEO優(yōu)化</A> </LI></UL>
 </DIV>
<!--子導航導航開始-->
 <DIV id=mainmenu_bottom>
 <DIV class=mainmenu_rbg>
  <UL class=hide id=mb1>
  <LI><A href="#">腳本下載-中小企業(yè)菜單特效專家</A> </LI>
  <LI><A href="#">網(wǎng)站公告:腳本下載歡迎您~</A> </LI>
  </UL>
  <UL class=hide id=mb2>
  <LI style="DISPLAY: none"><A href="#" target=_parent>腳本下載</A> </LI>
  <LI><A href="#" target=_parent>腳本下載</A> </LI>
  <LI><A href="#" target=_parent>腳本下載</A> </LI>
  <LI><A href="#" target=_parent>腳本下載</A> </LI>
  <LI><A href="#" target=_parent>網(wǎng)頁特效</A> </LI></UL>
  <UL class=hide id=mb3>
  <LI style="DISPLAY: none"><A href="#" target=_parent>腳本下載</A> </LI>
  <LI style="MARGIN-LEFT: 7px"><A href="#" target=_parent>腳本下載</A> </LI>
  <LI><A href="#" target=_parent>菜單特效</A> </LI>
  <LI><A href="#" target=_parent>菜單特效</A> </LI>
  <LI><A href="#" target=_parent>菜單特效</A> </LI>
  <LI><A href="#" target=_parent>網(wǎng)頁特效</A> </LI></UL>
  <UL class=hide id=mb4>
  <LI style="DISPLAY: none; MARGIN-LEFT: 80px"><A href="#" target=_parent>腳本下載</A> </LI>
  <LI style="MARGIN-LEFT: 80px"><A href="#" target=_parent>網(wǎng)頁特效</A> </LI>
  <LI><A href="#" target=_parent>菜單特效</A> </LI>
  <LI><A href="#" target=_parent>菜單特效</A> </LI></UL>
  <UL class=hide id=mb5>
  <LI style="DISPLAY: none"><A href="#" target=_parent>腳本下載</A> </LI>
  <LI style="MARGIN-LEFT: 80px"><A href="#" target=_parent>服務器租用</A> </LI>
  <LI><A href="#" target=_parent>菜單特效</A> </LI>
  <LI><A href="#" target=_parent>超級機房</A> </LI>
  <LI><A href="#" target=_parent>腳本下載</A> </LI></UL>
  <UL class=hide id=mb6>
  <LI style="DISPLAY: none"><A href="#" target=_parent>腳本下載</A> </LI>
  <LI style="MARGIN-LEFT: 160px"><A href="#" target=_parent>腳本下載</A> </LI>
  <LI><A href="#" target=_parent>腳本下載</A> </LI>
  <LI><A href="#" target=_parent>腳本下載</A> </LI></UL>
  <UL class=hide id=mb7>
  <LI style="DISPLAY: none"><A href="#" target=_parent>腳本下載</A> </LI>
  <LI style="MARGIN-LEFT: 180px"><A href="#" target=_parent>腳本下載</A> </LI>
  <LI><A href="#" target=_parent>腳本下載</A> </LI>
  <LI><A href="#" target=_parent>個人建站</A> </LI>
  <LI><A href="#" target=_parent>門戶建站</A> </LI></UL>
  <UL class=hide id=mb8 style="DISPLAY: none">
  <LI style="MARGIN-LEFT: 270px"><A href="/agent/" target=_parent>腳本下載</A> </LI>
  <LI><A href="#" target=_parent>菜單特效</A> </LI>
  <LI><A href="#" target=_parent>菜單特效</A> </LI></UL>
  <UL class=hide id=mb9>
  <LI style="MARGIN-LEFT: 180px"><A href="/agent/">腳本下載</A> </LI>
  <LI><A href="#" target=_parent>菜單特效</A> </LI>
  <LI><A href="#" target=_parent>菜單特效</A> </LI>
  <LI><A href="#" target=_parent>菜單特效</A> </LI></UL>
 </DIV>
 </DIV>
</DIV>
</body>
</html>

希望本文所述對大家的javascript程序設計有所幫助。

相關(guān)文章

  • 詳解微信小程序?qū)徍瞬煌ㄟ^的解決方法

    詳解微信小程序?qū)徍瞬煌ㄟ^的解決方法

    這篇文章主要介紹了詳解微信小程序?qū)徍瞬煌ㄟ^的解決方法,小編覺得挺不錯的,現(xiàn)在分享給大家,也給大家做個參考。一起跟隨小編過來看看吧
    2018-01-01
  • js查看一個函數(shù)的執(zhí)行時間實例代碼

    js查看一個函數(shù)的執(zhí)行時間實例代碼

    本篇文章給大家分享一段實例代碼,主要介紹js查看一個函數(shù)的執(zhí)行時間,代碼簡單易懂,感興趣的朋友一起跟著小編來學習學習吧
    2015-09-09
  • js為數(shù)字添加逗號并格式化數(shù)字的代碼

    js為數(shù)字添加逗號并格式化數(shù)字的代碼

    數(shù)字添加逗號的方法有很多,在本將為大家介紹下使用js來實現(xiàn),具體如下,感興趣的朋友可以參考下,希望對大家有所幫助
    2013-08-08
  • 詳解JS內(nèi)存空間

    詳解JS內(nèi)存空間

    因為JavaScript具有自動垃圾回收機制,所以對于前端開發(fā)來說,內(nèi)存空間并不是一個經(jīng)常被提及的概念。特別是很多不是計算機專業(yè)的朋友在進入到前端之后,會對內(nèi)存空間的認知比較模糊,甚至有些人干脆就是一無所知。為了解決大家的疑惑,本文將詳細介紹JS內(nèi)存空間
    2021-06-06
  • 重學JS 系列:聊聊繼承(推薦)

    重學JS 系列:聊聊繼承(推薦)

    這篇文章主要介紹了JS繼承,文中通過示例代碼介紹的非常詳細,對大家的學習或者工作具有一定的參考學習價值,需要的朋友們下面隨著小編來一起學習學習吧
    2019-04-04
  • 刪除table表格行的實例講解

    刪除table表格行的實例講解

    下面小編就為大家?guī)硪黄獎h除table表格行的實例講解。小編覺得挺不錯的,現(xiàn)在就分享給大家,也給大家做個參考。一起跟隨小編過來看看吧
    2017-09-09
  • 百度前臺js筆試題與答案

    百度前臺js筆試題與答案

    百度前臺js筆試題與答案...
    2007-09-09
  • JavaScript實現(xiàn)簡單購物小表格

    JavaScript實現(xiàn)簡單購物小表格

    這篇文章主要為大家詳細介紹了JavaScript實現(xiàn)簡單購物小表格,文中示例代碼介紹的非常詳細,具有一定的參考價值,感興趣的小伙伴們可以參考一下
    2021-09-09
  • JS逆向之?webpack?打包站點實戰(zhàn)原理分享

    JS逆向之?webpack?打包站點實戰(zhàn)原理分享

    本文主要介紹了JS逆向之webpack打包站點實戰(zhàn)原理分享,webpack是前端程序員用來進行打包JS的技術(shù),打包之后的代碼特征非常明顯,更多相關(guān)知識需要的小伙伴可以參考下面文章詳細內(nèi)容
    2022-06-06
  • javascript中的parseInt和parseFloat區(qū)別

    javascript中的parseInt和parseFloat區(qū)別

    這篇文章用簡單的小例子演示了parseInt和parseFloat區(qū)別,有需要的朋友可以參考一下
    2013-07-07

最新評論

闵行区| 鄂托克前旗| 台州市| 宣城市| 泽普县| 德阳市| 神木县| 娄烦县| 仁化县| 洛阳市| 磴口县| 新绛县| 昂仁县| 黄石市| 东明县| 杨浦区| 封丘县| 台湾省| 黎川县| 古丈县| 江城| 南丰县| 都江堰市| 泰和县| 清水县| 东城区| 五家渠市| 禄丰县| 威信县| 彭阳县| 信丰县| 晋城| 云林县| 察哈| 湾仔区| 甘德县| 翁牛特旗| 台东市| 永吉县| 洪江市| 呼伦贝尔市|