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

jQuery實(shí)現(xiàn)兩款有動(dòng)畫功能的導(dǎo)航菜單代碼

 更新時(shí)間:2015年09月16日 12:17:01   作者:企鵝  
這篇文章主要介紹了jQuery實(shí)現(xiàn)兩款有動(dòng)畫功能的導(dǎo)航菜單代碼,涉及jQuery動(dòng)畫效果的不同實(shí)現(xiàn)技巧,具有一定參考借鑒價(jià)值,需要的朋友可以參考下

本文實(shí)例講述了jQuery實(shí)現(xiàn)兩款有動(dòng)畫功能的導(dǎo)航菜單代碼。分享給大家供大家參考。具體如下:

這里介紹兩個(gè)有動(dòng)畫功能的jQuery導(dǎo)航菜單,每個(gè)具備移動(dòng)背景的效果,第二則是漸變背景效果,兩個(gè)都不錯(cuò),根據(jù)你的喜好選擇了,菜單的風(fēng)格和顏色自己修改一下就能用了。

運(yùn)行效果截圖如下:

在線演示地址如下:

http://demo.jb51.net/js/2015/jquery-2-animate-style-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">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>兩個(gè)有動(dòng)畫功能的導(dǎo)航菜單</title>
<script src="jquery-1.6.2.min.js" type="text/javascript"></script> 
<script type="text/javascript">
$(function()
{
 $("#test1 a").mouseover(function()
 { 
  var index = $("#test1 a").index(this);
  var width = $("#test1 a").width();
  $("#test1 .showhover").stop().animate({left:width*index},1000);
 })
 $("#test2 a").mouseover(function()
 { 
  var index = $("#test2 a").index(this);
  var width = $("#test2 a").width();
  $("#test2 .showhover").stop().animate({left:width*index,opacity:'0.6'},1000).stop(false,true).animate({opacity:'1.0'},500);
 })
})
</script> 
<style type="text/css">
.body {margin:10px;}
img {border:0;}
a {text-decoration:none;}
ul{list-style:none; margin:0; padding:0;}
.menu {background:#003399; height:25px; width:600px; position:relative; overflow:hidden;}
.menu .showmenu, .menu .showhover{ position:absolute;}
.menu .showmenu a {float:left; display:block;}
.menu .showmenu a {font:700 12px/25px Microsoft YaHei; color:#fff; width:100px; height:25px; text-align:center;}
.menu .showhover {background:#990033; width:100px; height:25px;}
</style>
</head>
<body>
<div class="menu" id="test1">
 <div class="showhover"></div>
 <div class="showmenu">
  <a href="#">網(wǎng)站首頁</a>
  <a href="#">關(guān)于我們</a>
  <a href="#">新聞中心</a>
  <a href="#">產(chǎn)品中心</a>
  <a href="#">解決方案</a>
  <a href="#">聯(lián)系我們</a>
 </div>
</div>
<div style="clear:both;height:50px;"></div>
<div class="menu" id="test2">
 <div class="showhover"></div>
 <div class="showmenu">
  <a href="#">網(wǎng)站首頁</a>
  <a href="#">關(guān)于我們</a>
  <a href="#">新聞中心</a>
  <a href="#">產(chǎn)品中心</a>
  <a href="#">解決方案</a>
  <a href="#">聯(lián)系我們</a>
 </div>
</div>
</body>
</html>

希望本文所述對(duì)大家的jQuery程序設(shè)計(jì)有所幫助。

相關(guān)文章

最新評(píng)論

阆中市| 元谋县| 潜江市| 南安市| 三台县| 敦化市| 柏乡县| 安化县| 崇阳县| 沈丘县| 留坝县| 大城县| 星子县| 泸溪县| 巴青县| 山东| 苍山县| 兴海县| 馆陶县| 福州市| 凉城县| 华安县| 荃湾区| 台北县| 巩义市| 星座| 塘沽区| 册亨县| 博罗县| 浦北县| 湘潭县| 常山县| 威信县| 新兴县| 贡觉县| 霍林郭勒市| 将乐县| 扶绥县| 化隆| 黄平县| 游戏|