jQuery ui實(shí)現(xiàn)動(dòng)感的圓角漸變網(wǎng)站導(dǎo)航菜單效果代碼
本文實(shí)例講述了jQuery ui實(shí)現(xiàn)動(dòng)感的圓角漸變網(wǎng)站導(dǎo)航菜單效果代碼。分享給大家供大家參考。具體如下:
今天給大家分享一款基于jQuery UI的網(wǎng)站漸變導(dǎo)航菜單,可作為主導(dǎo)航,帶漸入漸出效果,鼠標(biāo)移過(guò)菜單后,菜單項(xiàng)上顯示圓角背景,本地測(cè)試時(shí),請(qǐng)注意引入的幾個(gè)JS腳本文件,最好是保存到你本地,菜單兼容性也不錯(cuò)。
先來(lái)看運(yùn)行效果截圖:

在線演示地址如下:
http://demo.jb51.net/js/2015/jquery-ui-cicle-button-style-web-nav-codes/
具體代碼如下:
<!DOCTYPE html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=gb2312" />
<title>jQuery動(dòng)態(tài)效果導(dǎo)航菜單</title>
<style type="text/css">
<!--
@import url(http://fonts.googleapis.com/css?family=Lobster);
body {margin:0; padding:0; background:#ddd;}
#nav{position:relative; margin:40px; background:#eee; padding:0; font-family:'Lobster', Arial, Helvetica, sans-serif; font-size:21px; -moz-border-radius:5px; -khtml-border-radius:5px; -webkit-border-radius:5px; border-radius:5px; -moz-box-shadow:2px 2px 3px #ccc; -webkit-box-shadow:2px 2px 3px #ccc; box-shadow:2px 2px 3px #ccc;}
#nav .clear{clear:both;}
#nav ul{padding:0 0 0 5px; margin:0; list-style:none;}
#nav li{float:left; margin:5px 10px 5px 0; background:#eee; -moz-border-radius:5px; -khtml-border-radius:5px; -webkit-border-radius:5px; border-radius:5px;}
#nav li a{text-decoration:none; color:#9e0039; display:block; padding:10px 15px;}
-->
</style>
<script src="js/jquery-1.6.2.min.js"></script>
<script src="js/jquery-ui.min.js"></script>
<!-- rounded corners for IE -->
<script src="js/DD_roundies_0.0.2a-min.js"></script>
<script>
DD_roundies.addRule("#nav", "5px");
DD_roundies.addRule("#nav li", "5px");
</script>
<script>
$(document).ready(function(){
$nav_li=$("#nav li");
$nav_li_a=$("#nav li a");
var animSpeed=450; //fade speed
var hoverTextColor="#fff"; //text color on mouse over
var hoverBackgroundColor="#9e0039"; //background color on mouse over
var textColor=$nav_li_a.css("color");
var backgroundColor=$nav_li.css("background-color");
//text color animation
$nav_li_a.hover(function() {
var $this=$(this);
$this.stop().animate({ color: hoverTextColor }, animSpeed);
},function() {
var $this=$(this);
$this.stop().animate({ color: textColor }, animSpeed);
});
//background color animation
$nav_li.hover(function() {
var $this=$(this);
$this.stop().animate({ backgroundColor: hoverBackgroundColor }, animSpeed);
},function() {
var $this=$(this);
$this.stop().animate({ backgroundColor: backgroundColor }, animSpeed);
});
});
</script>
</head>
<body>
<div id="nav">
<ul>
<li><a href="#about">關(guān)于我</a></li>
<li><a href="#portfolio">配置說(shuō)明</a></li>
<li><a href="#recent">回收清單</a></li>
<li><a href="#experiments">心情速遞</a></li>
<li><a href="#contact">聯(lián)系我</a></li>
</ul>
<div class="clear"></div>
</div>
</body>
</html>
希望本文所述對(duì)大家的jquery程序設(shè)計(jì)有所幫助。
- jQuery實(shí)現(xiàn)的背景動(dòng)態(tài)變化導(dǎo)航菜單效果
- jQuery漸變發(fā)光導(dǎo)航菜單的實(shí)例代碼
- jquery仿京東導(dǎo)航/仿淘寶商城左側(cè)分類導(dǎo)航下拉菜單效果
- 基于jquery實(shí)現(xiàn)導(dǎo)航菜單高亮顯示(兩種方法)
- jquery實(shí)現(xiàn)點(diǎn)擊向下展開(kāi)菜單項(xiàng)(伸縮導(dǎo)航)效果
- jQuery仿京東商城樓梯式導(dǎo)航定位菜單
- jQuery實(shí)現(xiàn)的簡(jiǎn)潔下拉菜單導(dǎo)航效果代碼
- jquery實(shí)現(xiàn)無(wú)限分級(jí)橫向?qū)Ш讲藛蔚姆椒?/a>
- Jquery實(shí)現(xiàn)帶動(dòng)畫效果的經(jīng)典二級(jí)導(dǎo)航菜單
- jQuery實(shí)現(xiàn)的導(dǎo)航下拉菜單效果
- jQuery實(shí)現(xiàn)導(dǎo)航欄頭部菜單項(xiàng)點(diǎn)擊后變換顏色的方法
相關(guān)文章
jquery實(shí)現(xiàn)簡(jiǎn)單的彈窗效果
這篇文章主要為大家詳細(xì)介紹了jquery實(shí)現(xiàn)簡(jiǎn)單的彈窗效果,文中示例代碼介紹的非常詳細(xì),具有一定的參考價(jià)值,感興趣的小伙伴們可以參考一下2021-10-10
jquery事件機(jī)制擴(kuò)展插件 jquery鼠標(biāo)右鍵事件
jquery其實(shí)本身的事件機(jī)制就很完善了,包括了單擊,雙擊,鼠標(biāo)移入,鼠標(biāo)移出等。但是卻少了一個(gè)做事件。就是鼠標(biāo)右擊事件。當(dāng)然大家也是直接用偵聽(tīng)鼠標(biāo)按下事件,然后通過(guò)if來(lái)判斷執(zhí)行相應(yīng)的函數(shù)。造成鼠標(biāo)右擊事件的效果2011-12-12
頁(yè)面加載完成后再執(zhí)行JS的jquery寫法以及區(qū)別說(shuō)明
本篇文章主要是對(duì)頁(yè)面加載完成后再執(zhí)行JS的jquery寫法以及區(qū)別進(jìn)行了介紹,需要的朋友可以過(guò)來(lái)參考下,希望對(duì)大家有所幫助2014-02-02
精選的10款用于構(gòu)建良好易用性網(wǎng)站的jQuery插件
這篇隨筆收集了10款非常給力的jquery 插件,幫助你構(gòu)建易用性良好的網(wǎng)站,希望對(duì)你有用!2011-01-01
jQuery 獲取跨域XML(RSS)數(shù)據(jù)的相關(guān)總結(jié)分析
下面小編就為大家?guī)?lái)一篇jQuery 獲取跨域XML(RSS)數(shù)據(jù)的相關(guān)總結(jié)分析。小編覺(jué)得挺不錯(cuò)的,現(xiàn)在分享給大家,也給大家做個(gè)參考。一起跟隨小編過(guò)來(lái)看看吧2016-05-05
對(duì)之前寫的jquery分頁(yè)做下升級(jí)
之前寫的分頁(yè),操作時(shí)要把傳的參數(shù)放到隱藏hidden中,比較麻煩,下面重新包裝了一下,需要的朋友可以參考參考2014-06-06
jquery dataTable 獲取某行數(shù)據(jù)
本篇文章主要介紹了jquery dataTable 獲取某行數(shù)據(jù)的相關(guān)知識(shí),具有很好的參考價(jià)值。下面跟著小編一起來(lái)看下吧2017-05-05

