国产探花免费观看_亚洲丰满少妇自慰呻吟_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ā)表
主站蜘蛛池模板: 云阳县| 梧州市| 泽库县| 永和县| 南乐县| 枣强县| 中超| 县级市| 老河口市| 芮城县| 潮安县| 宝丰县| 砚山县| 库伦旗| 天峨县| 合山市| 吴忠市| 通河县| 仙桃市| 峨眉山市| 余庆县| 赤城县| 勃利县| 普格县| 钟山县| 阿坝| 古田县| 晋城| 犍为县| 钟山县| 兴仁县| 秀山| 磐石市| 长子县| 汾阳市| 淮安市| 衡东县| 台北县| 防城港市| 内丘县| 民勤县|