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

首頁 > 編程 > JavaScript > 正文

jquery動(dòng)感漂浮導(dǎo)航菜單代碼分享

2019-11-20 11:48:50
字體:
供稿:網(wǎng)友

這是一款基于jquery實(shí)現(xiàn)動(dòng)感漂浮導(dǎo)航菜單的特效代碼,菜單可以上下浮動(dòng),動(dòng)感十足,為自己的網(wǎng)站增加了活力,是一款非常實(shí)用的導(dǎo)航菜單特效源碼。

運(yùn)行效果圖:

點(diǎn)擊下載源碼

為大家分享的jquery動(dòng)感漂浮導(dǎo)航菜單代碼如下

<head> <meta http-equiv="Content-Type" content="text/html; charset=utf-8"> <title>jQuery Floating Menu</title> <script type="text/javascript" src="js/jquery-1.3.1.min.js"></script> <script type="text/javascript" src="js/jquery.easing.1.3.js"></script> <script>  $(document).ready(function () { //get the default top value var top_val = $('#menu li a').css('top'); //animate the selected menu item $('#menu li.selected').children('a').stop().animate({top:0}, {easing: 'easeOutQuad', duration:500});  $('#menu li').hover( function () {  //animate the menu item with 0 top value $(this).children('a').stop().animate({top:0}, {easing: 'easeOutQuad', duration:500});  }, function () { //set the position to default $(this).children('a').stop().animate({top:top_val}, {easing: 'easeOutQuad', duration:500});  //always keep the previously selected item in fixed position  $('#menu li.selected').children('a').stop().animate({top:0}, {easing: 'easeOutQuad', duration:500});  }  );  });  </script>  <style>  #menu { list-style:none;  padding:0; margin:0 auto;; height:70px; width:600px; }  #menu li { float:left; width:109px; height:inherit; position:relative; overflow:hidden; } #menu li a { position:absolute; top:20px; text-indent:-999em; background:url(menu.png) no-repeat 0 0; display:block;  width:109px;  height:inherit; /* fast png fix for ie6 */ position:relative; behavior: expression((this.runtimeStyle.behavior="none")&&(this.pngSet?this.pngSet=true:(this.nodeName == "IMG" && this.src.toLowerCase().indexOf('.png')>-1?(this.runtimeStyle.backgroundImage = "none",this.runtimeStyle.filter = "progid:DXImageTransform.Microsoft.AlphaImageLoader(src='" + this.src + "', sizingMethod='image')",this.src = "transparent.gif"):(this.origBg = this.origBg? this.origBg :this.currentStyle.backgroundImage.toString().replace('url("','').replace('")',''),this.runtimeStyle.filter = "progid:DXImageTransform.Microsoft.AlphaImageLoader(src='" + this.origBg + "', sizingMethod='crop')",this.runtimeStyle.backgroundImage = "none")),this.pngSet=true)); }  </style> </head><body><br/><br/><br/><ul id="menu"> <li><a href="#">Item 1</a></li> <li><a href="#">Item 2</a></li> <li><a href="#">Item 3</a></li> <li><a href="#">Item 4</a></li> <li><a href="#">Item 5</a></li></ul><head> <meta http-equiv="Content-Type" content="text/html; charset=utf-8"> <title>jQuery Floating Menu</title> <script type="text/javascript" src="js/jquery-1.3.1.min.js"></script> <script type="text/javascript" src="js/jquery.easing.1.3.js"></script> <script>  $(document).ready(function () { //get the default top value var top_val = $('#menu li a').css('top'); //animate the selected menu item $('#menu li.selected').children('a').stop().animate({top:0}, {easing: 'easeOutQuad', duration:500});  $('#menu li').hover( function () {  //animate the menu item with 0 top value $(this).children('a').stop().animate({top:0}, {easing: 'easeOutQuad', duration:500});  }, function () { //set the position to default $(this).children('a').stop().animate({top:top_val}, {easing: 'easeOutQuad', duration:500});  //always keep the previously selected item in fixed position  $('#menu li.selected').children('a').stop().animate({top:0}, {easing: 'easeOutQuad', duration:500});  }  );  });  </script>  <style>  #menu { list-style:none;  padding:0; margin:0 auto;; height:70px; width:600px; }  #menu li { float:left; width:109px; height:inherit; position:relative; overflow:hidden; } #menu li a { position:absolute; top:20px; text-indent:-999em; background:url(menu.png) no-repeat 0 0; display:block;  width:109px;  height:inherit; /* fast png fix for ie6 */ position:relative; behavior: expression((this.runtimeStyle.behavior="none")&&(this.pngSet?this.pngSet=true:(this.nodeName == "IMG" && this.src.toLowerCase().indexOf('.png')>-1?(this.runtimeStyle.backgroundImage = "none",this.runtimeStyle.filter = "progid:DXImageTransform.Microsoft.AlphaImageLoader(src='" + this.src + "', sizingMethod='image')",this.src = "transparent.gif"):(this.origBg = this.origBg? this.origBg :this.currentStyle.backgroundImage.toString().replace('url("','').replace('")',''),this.runtimeStyle.filter = "progid:DXImageTransform.Microsoft.AlphaImageLoader(src='" + this.origBg + "', sizingMethod='crop')",this.runtimeStyle.backgroundImage = "none")),this.pngSet=true)); }  </style> </head><body><br/><br/><br/><ul id="menu"> <li><a href="#">Item 1</a></li> <li><a href="#">Item 2</a></li> <li><a href="#">Item 3</a></li> <li><a href="#">Item 4</a></li> <li><a href="#">Item 5</a></li></ul>

以上就是為大家分享的jquery動(dòng)感漂浮導(dǎo)航菜單代碼,希望大家可以喜歡。

發(fā)表評論 共有條評論
用戶名: 密碼:
驗(yàn)證碼: 匿名發(fā)表
主站蜘蛛池模板: 合水县| 醴陵市| 于田县| 涞源县| 宁阳县| 靖西县| 托里县| 井冈山市| 襄汾县| 墨竹工卡县| 平潭县| 蒙自县| 沙洋县| 靖西县| 湘乡市| 两当县| 长兴县| 通化县| 永新县| 泗洪县| 同德县| 四子王旗| 濮阳市| 凤山县| 焦作市| 禹城市| 习水县| 阿巴嘎旗| 井冈山市| 沛县| 永胜县| 厦门市| 临泽县| 乌拉特中旗| 黄陵县| 阳城县| 赣榆县| 胶州市| 石林| 溧水县| 湘潭市|