[英]How can I make a navigation bar that converts to a button for a sidebar when scaled down too much?
I have seen many sites with a navigation bar that will convert to a button that opens a menu if the page is scaled down too much. 我见过很多带有导航栏的站点,如果页面缩小太多,导航栏会转换为打开菜单的按钮。 An example of this: www.aurelswonderland.com (Scale the windows width down and watch the nav bar dissapear)
例如:www.aurelswonderland.com(缩小窗口宽度并观看导航栏消失)
How can I implement this myself? 我如何自己实现呢?
Unless you are using Bootstrap or Foundation, I like to use SlickNav. 除非您使用Bootstrap或Foundation,否则我喜欢使用SlickNav。 It's a jQuery plugin that's very easy to use.
这是一个非常易于使用的jQuery插件。 You just call the slicknav() function on the "ul" in your navigation and you're good to go.
您只需在导航中的“ ul”上调用slicknav()函数,就可以了。 You can also pass in options as in most jQuery plugins.
您也可以像大多数jQuery插件一样传递选项。
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.