Home > Article > Web Front-end > JQuery adaptive window size navigation menu with source code download_jquery
The rendering is as follows:
View the demo Source code download
html code:
<h1>jQuery / Zepto响应式菜单 PgwMenu 演示</h1> <p class="dowebok-explain">请缩小/放大浏览器窗口宽度查看效果</p> <h2>深色样式(默认)</h2> <ul class="pgwMenu"> <li><a class="selected" href="http://www.jb51.net/">首页</a></li> <li><a href="http://www.jb51.net/">代码</a></li> <li><a href="http://www.jb51.net/">素材</a></li> <li><a href="http://www.jb51.net/">模板</a></li> <li><a href="javascript:">关于</a></li> <li><a href="javascript:">服务</a></li> <li><a href="http://www.jb51.net/">联系</a></li> </ul> <h2>浅色样式(默认)</h2> <ul class="pgwMenu light"> <li><a class="selected" href="http://www.jb51.net/">首页</a></li> <li><a href="http://www.jb51.net/">代码</a></li> <li><a href="http://www.jb51.net/">素材</a></li> <li><a href="http://www.jb51.net/">模板</a></li> <li><a href="javascript:">关于</a></li> <li><a href="javascript:">服务</a></li> <li><a href="http://www.jb51.net/">联系</a></li> </ul> <h2>自定义样式</h2> <ul class="pgwMenuCustom"> <li><a class="selected" href="http://www.jb51.net/">首页</a></li> <li><a href="http://www.jb51.net/">代码</a></li> <li><a href="http://www.jb51.net/">素材</a></li> <li><a href="http://www.jb51.net/">模板</a></li> <li><a href="javascript:">关于</a></li> <li><a href="javascript:">服务</a></li> <li><a href="http://www.jb51.net/">联系</a></li> </ul>
Js code
$(function () { $('.pgwMenu').pgwMenu({ dropDownLabel: '菜单', viewMoreLabel: '更多<span class="icon"></span>' }); $('.pgwMenuCustom').pgwMenu({ mainClassName: 'pgwMenuCustom', dropDownLabel: '菜单', viewMoreLabel: '更多<span class="icon"></span>' }); });
The above is the entire content of this article introducing you to the JQuery adaptive window size navigation menu. I hope you like it.