0
A
回答
1
這tutorial由Josh Morony應該讓你開始!玩得開心!
2
I hope this will help you.
<header>
<div class="header-banner">
</div>
<nav>
<ul>
<li><a href="#">$4,456-5,778 your text</a></li>
</ul>
</nav>
</header>
<section class="content">
<p>Here add huge dummy content to check scroll position.</p>
</section>
header {
height:360px;
}
.header-banner {
background-color: red;
width: 100%;
height: 300px;
}
.fixed-header {
position: fixed;
top:0; left:0;
width: 100%;
}
nav {
width:100%;
height:60px;
background: #292f36;
postion:fixed;
z-index:10;
}
nav ul {
list-style-type: none;
margin: 0 auto;
padding-left:0;
text-align:right;
width: 960px;
max-width: 100%;
}
nav ul li {
display: inline-block;
line-height: 60px;
margin-left: 10px;
}
nav ul li a {
text-decoration: none;
color: #a9abae;
}
$(window).scroll(function(){
if ($(window).scrollTop() >= 300) {
$('nav').addClass('fixed-header');
}
else {
$('nav').removeClass('fixed-header');
}
});
相關問題
- 1. 標題導航幻燈片
- 2. 幻燈片導航
- 3. 幻燈片導航中的問題
- 4. 幻燈片導航菜單
- 5. 幻燈片顯示越過導航欄和導航欄元素定位
- 6. 全屏導航頁面幻燈片
- 7. fancybox裏面的幻燈片
- 8. jquery幻燈片導航問題
- 9. IOS PowerPoint幻燈片導航
- 10. jQuery導航幻燈片
- 11. 如何更改Ionic 2中的標題欄/導航欄
- 12. Ionic 2幻燈片自動播放
- 13. ionic 2 Android標題和按鈕未在導航欄中對齊
- 14. 標誌和導航軌道上的照片幻燈片
- 15. 幻燈片標籤欄
- 16. 幻燈片和顯示導航
- 17. 在幻燈片導航中選擇圖像幻燈片
- 18. GalleryView - 不改變面板中的圖片的幻燈片導航
- 19. 幻燈片效果的導航菜單
- 20. 隱藏在JQuery幻燈片背後的JQuery導航欄
- 21. 的Javascript:自動播放幻燈片導航欄
- 22. 簡單的幻燈片導航覆蓋
- 23. 簡單的jQuery幻燈片導航?
- 24. 簡單的幻燈片與導航
- 25. 問題頁面幻燈片
- 26. Ionic2在幻燈片中導航
- 27. 從導航欄頂部的動畫UISearchBar幻燈片
- 28. VBA PowerPoint幻燈片標題
- 29. 導航欄卡住在幻燈片中html
- 30. 在幻燈片放映中放置項目符號導航欄
謝謝同名!這是完美的 –
沒問題,總是樂於幫忙! – David
好的答案不僅僅是簡單地引用外部網站,並建議OP引用它。主要引用外部網站的答案應該包括信息摘要,以便它成爲主要來源以及參考資料([更多信息...](https://meta.stackexchange.com/questions/8231/) -answers - 即,剛剛包含鏈接別處 - 真的好 - 答案)) – sebaferreras