0
我試圖複製類似於此website的導航欄。所以當用戶打開網站時有一個非粘性的導航欄,並且在用戶向下滾動一點之後,不粘的導航欄消失了,並被一個粘滯的導航欄取代。我如何用物化css達到這樣的效果?到目前爲止,我只取得了不粘性導航欄部分navbar更改滾動時,實現css
<nav class="nav-extended">
<div class="nav-wrapper">
<a href="#" class="brand-logo"><img src="viva.png" alt="" id="logo"></a>
<ul id="nav-mobile" class="right hide-on-med-and-down">
<li>
<form>
<div class="input-field">
<input id="search" type="search" required>
<label class="label-icon" for="search"><i class="material-icons"></i></label>
<i class="material-icons">close</i>
</div>
</form>
</li>
<li><a href="#">Register</a></li>
<li>|</li>
<li><a href="#">Login</a></li>
</ul>
</div>
<hr>
<div class="nav-content">
<ul class="tabs tabs-transparent">
<li class="tab"><a href="#">Test 1</a></li>
<li class="tab"><a href="#">Test 2</a></li>
<li class="tab"><a href="#">Test 3</a></li>
</ul>
</div>
</nav>
試試這個http://www.jozefbutko.com/stickynavbar/ –