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

首頁 > 編程 > JavaScript > 正文

jQuery實現帶滑動條的菜單效果代碼

2019-11-20 11:42:17
字體:
來源:轉載
供稿:網友

本文實例講述了jQuery實現帶滑動條的菜單效果代碼。分享給大家供大家參考。具體如下:

這是一款帶滑動條的jQuery滑動菜單,菜單下邊有一個藍色的線條,鼠標移上哪里它就跟向哪里,可以指引當前菜單的位置,另外,動畫效果是基于jquery的animate(),對此有興趣學習的正好可參考下代碼。

運行效果截圖如下:

在線演示地址如下:

http://demo.VeVB.COm/js/2015/jquery-move-buttom-line-style-codes/

具體代碼如下:

<!DOCTYPE HTML><html><head><meta charset="gb2312"><title>帶滑動條的jQuery滑動菜單</title><style>body{ font:12px/1.5 Arial,/5b8b/4f53,sans-serif;background:#fff; color:#333; position:relative}.header { width:990px; min-width:990px; margin:0 auto; height:68px; position:relative; z-index:200; overflow:hidden}.headerTab { height:44px; padding:24px 0 0 0; position:relative; width:990px; min-width:990px; margin:0 auto; }.headerTab a { padding:0 5px; float:left; font-size:14px; color:#333; height:42px; overflow:hidden; line-height:44px;font-family:/5FAE/8F6F/96C5/9ED1,/5B8B/4F53; margin-left:10px; display:inline}.headerTab a:hover { text-decoration:none; color:#333}.headerTab .tabLine { position:absolute; top:66px; height:2px; background:#35b0f2; left:0; width:100%; overflow:hidden; font-size:0; line-height:0;}</style></head><body><div class="headerTab" id="headerTab"><a href="#" title="">武林網</a><a href="#" title="">下載中心</a><a href="#" title="">最新更新</a><a href="#" title="">廣告中心</a><a href="#" target="_blank" title="">Delphi源碼</a><a href="#" target="_blank" title="">VC++源碼</a><a href="#" title="">更新日志</a><i class="tabLine"></i></div></body><script type="text/javascript" src="jquery-1.6.2.min.js"></script><script>var headerTabArray = $("#headerTab a"),headTabLine = $("#headerTab .tabLine"),tabIndex,headerTabArrayLength = headerTabArray.length,headerTabWidthArray = [],headerTabPositonArray = [],defaultNum = 0;for(var i=0;i<headerTabArrayLength;i++){  headerTabWidthArray[i] = headerTabArray.eq(i).width() + 10;  headerTabPositonArray[i] = headerTabArray.eq(i).position().left + 10;  }headerTabArray.mouseover(function(){  $("#headerTab i:animated").stop();  tabIndex = $(this).index();  headTabLine.animate({width:headerTabWidthArray[tabIndex],left:headerTabPositonArray[tabIndex]},300);})headerTabArray.mouseout(function(){  $("#headerTab i:animated").stop();  tabIndex = $(this).index();  headTabLine.animate({width:headerTabWidthArray[defaultNum],left:headerTabPositonArray[defaultNum]},300);})defaultNum = 0;headTabLine.animate({width:headerTabWidthArray[defaultNum],left:headerTabPositonArray[defaultNum]},300);</script></html>

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

發表評論 共有條評論
用戶名: 密碼:
驗證碼: 匿名發表
主站蜘蛛池模板: 连云港市| 萝北县| 和田县| 郴州市| 皋兰县| 南康市| 博湖县| 沾益县| 千阳县| 新巴尔虎右旗| 马鞍山市| 宁海县| 鄂伦春自治旗| 万宁市| 资兴市| 徐州市| 常德市| 普兰店市| 石柱| 岳阳县| 岚皋县| 汪清县| 罗江县| 大荔县| 高碑店市| 马龙县| 龙陵县| 陇南市| 石河子市| 青州市| 巩义市| 漳平市| 永康市| 河池市| 新化县| 黄浦区| 简阳市| 文安县| 扬中市| 普兰店市| 安溪县|