素材牛VIP会员

jQuery自适应导航菜单效果代码

 所属分类:网页特效-导航菜单

 浏览:2940次  评论:1次  更新时间:2016-09-01
牛币素材VIP可免积分下载
jQuery自适应导航菜单效果代码兼容IE8
积分说明:注册即送10牛币,每日签到可获得5牛币,成为VIP会员可永久免牛币下载!   充值积分   充值会员   更多说明»
素材描述:一款响应式导航菜单特效,完美兼容支持手机浏览

详细介绍

使用方法:

引用CSS样式

<link rel="stylesheet" href="css/pgwmenu.css">

自定义样式

.pgwMenuCustom { background: #f1941c; height: 40px; position: relative; list-style: none }
.pgwMenuCustom ul { list-style: none; white-space: nowrap; margin: 0; padding: 0 }
.pgwMenuCustom .pm-links.mobile, .pgwMenuCustom .pm-viewMore>ul { background: #f1941c; box-shadow: 2px 2px 4px #777; position: absolute; left: 0; top: 100%; z-index: 1000 }
.pgwMenuCustom .pm-links.mobile li, .pgwMenuCustom .pm-viewMore>ul>li { display: block; clear: both; width: 175px }
.pgwMenuCustom li { float: left }
.pgwMenuCustom a { display: block; color: #fff; line-height: 40px; padding: 0 30px; text-decoration: none }
.pgwMenuCustom a.selected { background: #e5601d }
.pgwMenuCustom li a:hover { background: #e86f2e; text-decoration: none }
.pgwMenuCustom .pm-dropDown, .pgwMenuCustom .pm-viewMore, .pgwMenuCustom .pm-viewMore>ul { display: none }
.pgwMenuCustom .pm-dropDown a { display: inline-block; background: #e86f2e }
.pgwMenuCustom .pm-dropDown a.active, .pgwMenuCustom .pm-viewMore a.active { background: #e5601d }
.pgwMenuCustom .pm-dropDown span.icon, .pgwMenuCustom .pm-dropDown span.black { background: url(data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABYAAAAWCAYAAADEtGw7AAAABGdBTUEAALGPC/xhBQAAAAlwSFlzAAAOvgAADr4B6kKxwAAAABZ0RVh0U29mdHdhcmUAcGFpbnQubmV0IDQuMDvo9WkAAABpSURBVEhL7ZPLCcAwDEM9jefI/ks1Hyj2QbiGSLcKHggl8sEktjTc/WGyZxo6YKAbrFzFoav3/hdhmsrlijBN5XJFmKZyuSJMU7lcsfV/kIN0FRJgyACGDGDIAIYMpK8CHt6iG6xZhY0JIJ+6AHGbUFsAAAAASUVORK5CYII=) no-repeat; display: block; height: 22px; width: 22px; margin: 9px 5px }
.pgwMenuCustom .pm-dropDown span.white { background: url(data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABYAAAAWCAYAAADEtGw7AAAABGdBTUEAALGPC/xhBQAAAAlwSFlzAAAOwQAADsEBuJFr7QAAABZ0RVh0U29mdHdhcmUAcGFpbnQubmV0IDQuMDvo9WkAAABKSURBVEhL7ZOxDQAwCMN6O4/T0tmjsxHJDB4yROJ0dz3s1BRHEi2OTREBpQFKA5QGKA3m7IP8RKeIgNIApQFKA5QGc/ZBfkJTdF0oUafLBAFNbAAAAABJRU5ErkJggg==) no-repeat; display: block; height: 22px; width: 22px; margin: 9px 5px }
.pgwMenuCustom .pm-viewMore { display: none; position: relative }
.pgwMenuCustom .pm-viewMore>a { display: inline-block }
.pgwMenuCustom .pm-viewMore>ul { left: auto; right: 0 }
.pgwMenuCustom .pm-viewMore li { float: none }
.pgwMenuCustom .pm-viewMore span.icon, .pgwMenuCustom .pm-viewMore span.white { border-color: #fff transparent; border-style: solid; border-width: 8px 6px 0; margin-left: 3px; display: inline-block }
.pgwMenuCustom .pm-viewMore span.black { border-color: #000 transparent; border-style: solid; border-width: 8px 6px 0; margin-left: 3px; display: inline-block }

引入jQuery库文件、插件JS文件

<script type="text/javascript" src="js/jquery-1.8.3.min.js">script>
<script type="text/javascript" src="js/pgwmenu.min.js">script>

插件初始化、配置

$(function() {
	$('.pgwMenu').pgwMenu({
		dropDownLabel: '菜单',
		viewMoreLabel: '更多'
	});
	$('.pgwMenuCustom').pgwMenu({
		mainClassName: 'pgwMenuCustom',
		dropDownLabel: '菜单',
		viewMoreLabel: '更多'
	});
});

HTML结构

<ul class="pgwMenu light">
  <li><a class="selected" href="http://www.sucainiu.com/">首页a>li>
  <li><a href="http://www.sucainiu.com/">代码a>li>
  <li><a href="http://www.sucainiu.com/">素材a>li>
  <li><a href="http://www.sucainiu.com/">模板a>li>
  <li><a href="javascript:">关于a>li>
  <li><a href="javascript:">服务a>li>
  <li><a href="http://www.sucainiu.com/">联系a>li>
ul>

相关素材 - 导航菜单

讨论这个素材(1)回答他人问题或分享使用心得会奖励牛币

流***雨  
2016年09月04日

就是兼容还不到位o(︶︿︶)o 唉

回复
 文明上网,理性发言!   😉 阿里云幸运券,戳我领取
我的牛币余额:0
所需牛币:1 开始下载

牛币获取:签到、评论、充值    » 在线充值(10牛币=1元)