[英]Fixing div navigation from hiding upon scroll
I have this sample HTML5 page which have a navigation and a content area pasted on JSFiddle . 我有这个示例HTML5页面,该页面具有导航和粘贴在JSFiddle上的内容区域。
The problem is that <div id="nav">
isn't fixed when I scroll vertically. 问题是,垂直滚动时
<div id="nav">
并没有固定。 How can I make the navigation to be fixed on the top of the browser even with scrolled vertically? 即使垂直滚动,如何将导航固定在浏览器顶部?
Create another hidden navigation (same with already used nav), and show it when user scrolls down enough. 创建另一个隐藏的导航(与已经使用的导航相同),并在用户向下滚动足够时显示它。
Here is a good tutorial to do that. 这是一个很好的教程 。
And here is some edited and working example from my website. 这是我网站上一些经过编辑且有效的示例 。
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.