jQuery 實(shí)現(xiàn)扁平式小清新導(dǎo)航
效果圖

1.html部分
<!DOCTYPE html> <html lang="en"> <head> <meta charset="UTF-8"> <title>index</title> <link rel="stylesheet" href="css/style.css" rel="external nofollow" > </head> <body> <!-- 導(dǎo)航nav --> <ul id="navigation"> <li class="home"><a href=""><span>Home</span></a></li> <li class="about"><a href=""><span>About</span></a></li> <li class="search"><a href=""><span>Search</span></a></li> <li class="photos"><a href=""><span>Photos</span></a></li> <li class="rssfeed"><a href=""><span>Rss Feed</span></a></li> <li class="podcasts"><a href=""><span>Podcasts</span></a></li> <li class="contact"><a href=""><span>Contact</span></a></li> </ul> <div class="info"> </div> <script src='https://libs.baidu.com/jquery/1.7.1/jquery.min.js'></script> <script src="js/script.js"></script> </body> </html>
2.CSS部分
ul#navigation {
position:fixed;
margin:0;
padding:0;
top:0;
right:10px;
list-style:none;
z-index:999999;
width:721px
}
ul#navigation li {
width:103px;
display:inline;
float:left
}
ul#navigation li a {
display:block;
float:left;
margin-top:-2px;
width:100px;
height:25px;
background-color:#e7f2f9;
background-repeat:no-repeat;
background-position:50% 10px;
border:1px solid #bddcef;
-moz-border-radius:0 0 10px 10px;
-webkit-border-bottom-right-radius:10px;
-webkit-border-bottom-left-radius:10px;
-khtml-border-bottom-right-radius:10px;
-khtml-border-bottom-left-radius:10px;
text-decoration:none;
text-align:center;
padding-top:80px;
opacity:.7;
filter:alpha(opacity=70)
}
ul#navigation li a:hover {
background-color:#cae3f2
}
ul#navigation li a span {
letter-spacing:2px;
font-size:11px;
color:#60acd8;
text-shadow:0 -1px 1px #fff
}
ul#navigation .home a {
background-image:url(../images/home.png)
}
ul#navigation .about a {
background-image:url(../images/id_card.png)
}
ul#navigation .search a {
background-image:url(../images/search.png)
}
ul#navigation .podcasts a {
background-image:url(../images/ipod.png)
}
ul#navigation .rssfeed a {
background-image:url(../images/rss.png)
}
ul#navigation .photos a {
background-image:url(../images/camera.png)
}
ul#navigation .contact a {
background-image:url(../images/mail.png)
}
a.dry {
position:absolute;
bottom:15px;
left:15px;
text-align:left;
font-size:12px;
color:#ccc;
text-transform:uppercase;
text-decoration:none
}
3.js部分
$(function() {
var d=300;
$('#navigation a').each(function(){
$(this).stop().animate({
'marginTop':'-80px'
},d+=150);
});
$('#navigation > li').hover(
function () {
$('a',$(this)).stop().animate({
'marginTop':'-2px'
},200);
},
function () {
$('a',$(this)).stop().animate({
'marginTop':'-80px'
},200);
}
);
});
圖片素材如下

以上就是jQuery 實(shí)現(xiàn)扁平式小清新導(dǎo)航的詳細(xì)內(nèi)容,更多關(guān)于jQuery 導(dǎo)航的資料請(qǐng)關(guān)注腳本之家其它相關(guān)文章!
- jquery實(shí)現(xiàn)垂直手風(fēng)琴導(dǎo)航欄
- jquery實(shí)現(xiàn)吸頂導(dǎo)航效果
- jquery實(shí)現(xiàn)二級(jí)導(dǎo)航下拉菜單效果實(shí)例
- jQuery對(duì)底部導(dǎo)航進(jìn)行跳轉(zhuǎn)并高亮顯示的實(shí)例代碼
- jQuery實(shí)現(xiàn)的導(dǎo)航條點(diǎn)擊后高亮顯示功能示例
- jQuery實(shí)現(xiàn)導(dǎo)航樣式布局操作示例【可自定義樣式布局】
- jQuery 導(dǎo)航自動(dòng)跟隨滾動(dòng)的實(shí)現(xiàn)代碼
相關(guān)文章
jQuery實(shí)現(xiàn)點(diǎn)擊圖片翻頁展示效果的方法
這篇文章主要介紹了jQuery實(shí)現(xiàn)點(diǎn)擊圖片翻頁展示效果的方法,涉及jQuery操作圖片的操作技巧,非常具有實(shí)用價(jià)值,需要的朋友可以參考下2015-02-02
jQuery Uploadify 上傳插件出現(xiàn)Http Error 302 錯(cuò)誤的解決辦法
本文給大家介紹jQuery Uploadify 上傳插件出現(xiàn)Http Error 302 錯(cuò)誤的解決辦法,涉及到uploadify上傳錯(cuò)誤302相關(guān)問題,對(duì)本文感興趣的朋友一起看看吧2015-12-12
使用jQuery插件創(chuàng)建常規(guī)模態(tài)窗口登陸效果
隱藏模態(tài)窗口技術(shù)是一種很好的解決方案,用于處理不是特有必要出現(xiàn)在網(wǎng)頁上的界面元素,下面與大家分享下如何利用jQuery插件leanModal建立一個(gè)常規(guī)模態(tài)窗口2013-08-08
jQuery 獲取除某指定對(duì)象外的其他對(duì)象 ( :not() 與.not())
這篇文章主要介紹了JQuery 獲取除某指定對(duì)象外的其他對(duì)象 ( :not() 與.not()),需要的朋友可以參考下2018-10-10
jQuery 實(shí)現(xiàn)鼠標(biāo)畫框并對(duì)框內(nèi)數(shù)據(jù)選中的實(shí)例代碼
本文通過實(shí)例代碼給大家介紹了jQuery 實(shí)現(xiàn)鼠標(biāo)畫框并對(duì)框內(nèi)數(shù)據(jù)選中的實(shí)例代碼,非常不錯(cuò),具有參考借鑒價(jià)值,需要的朋友參考下吧2017-08-08
解決jquery validate 驗(yàn)證不通過后驗(yàn)證正確的信息仍殘留在label上的方法
在本篇文章里小編給大家整理了關(guān)于解決jquery validate 驗(yàn)證不通過后驗(yàn)證正確的信息仍殘留在label上的方法,有需要的朋友們可以學(xué)習(xí)下。2019-08-08
jQuery樹形插件jquery.simpleTree.js用法分析
這篇文章主要介紹了jQuery樹形插件jquery.simpleTree.js用法,結(jié)合實(shí)例形式分析了jQuery樹形菜單插件jquery.simpleTree.js的功能與基本用法,需要的朋友可以參考下2016-09-09
jquery+css+html實(shí)現(xiàn)飛機(jī)大戰(zhàn)游戲
這篇文章主要為大家詳細(xì)介紹了jquery+css+html實(shí)現(xiàn)飛機(jī)大戰(zhàn)游戲,文中示例代碼介紹的非常詳細(xì),具有一定的參考價(jià)值,感興趣的小伙伴們可以參考一下2022-05-05

