最近在浏览东西时不小心发现 GitHub 上也有 panolens.js 的 文档和demo 。
大概分为两种模式,模块化引用 和 普通html引用,如下图:
本文章主要分享一下 普通html引入 ,举个栗子:
哇哦竟然实现了,小伙伴们赶快试试吧~~~ 记得点赞哦~~~
<!-- 三级操蛋导航 --><div class="nav_left">
<div class="nav_leftlist">
<h2><b></b>用户系统</h2>
<dl>
<dt><b></b>用户管理</dt>
<dd>
<a class="cur" href="">商户信息<b></b></a>
<a href="">用户信息<b></b></a>
</dd>
</dl>
</div>
<div class="nav_leftlist">
<h2><b></b>财务系统</h2>
<dl>
<dt><b></b>系统账务</dt>
<dd>
<a href="">平台账单<b></b></a>
<a href="">账单明细<b></b></a>
</dd>
</dl>
<dl>
<dt><b></b>商户账务</dt>
<dd>
<a href="">商户账单<b></b></a>
<a href="">提现管理<b></b></a>
</dd>
</dl>
<dl>
<dt><b></b>用户账务</dt>
<dd>
<a href="">用户账单<b></b></a>
<a href="">提现管理<b></b></a>
</dd>
</dl>
</div>
</div>
<style>
.nav_left{background: #232b35height: 100%width: 220pxmin-height: 600pxposition: fixedtop: 100pxleft: 0}
.nav_leftlist{}
.nav_leftlist h2{height: 50pxline-height: 50pxpadding-left: 40pxfont-size: 16pxbackground: #3b444fcolor: #999999position: relativecursor: pointer}
.nav_leftlist h2 b{position: absolutetop: 20pxleft: 13pxwidth: 16pxheight: 9pxbackground: url(../images/icon04.png) no-repeatbackground-position: 0 0cursor: pointer}
.nav_leftlist h2 b.cur{background-position: -16px 0}
.nav_leftlist dl{}
.nav_leftlist dl dt{height: 50pxline-height: 50pxbackground: #2c3643font-size: 16pxcolor: #ffffffpadding-left: 60pxposition: relativecursor: pointer}
.nav_leftlist dl dt b{position: absolutetop: 20pxleft: 34pxwidth: 16pxheight: 9pxbackground: url(../images/icon04.png) no-repeatbackground-position: 0 -10px}
.nav_leftlist dl dt b.cur{background-position: -16px -10px}
.nav_leftlist dl dd{}
.nav_leftlist dl dd a{display: blockheight: 50pxline-height: 50pxcolor: #fffpadding-left: 80pxfont-size: 16pxposition: relative}
.nav_leftlist dl dd a.cur{color: #ee581c}
.nav_leftlist dl dd a.cur b{display: blockposition: absolutetop: 16pxright: -1pxwidth: 11pxheight: 18pxbackground: url(../images/icon04.png) no-repeatbackground-position: 0 -20px}
</style>
</body>
<script type="text/javascript" src="../js/jquery.js" ></script>
<script type="text/javascript" >
$(function(){
$('.nav_leftlist').on('click', 'h2', function(event) {
$(this).siblings('dl').toggle()
if($(this).siblings('dl').css('display')=='none'){
$(this).find('b').addClass('cur')
}else{
$(this).find('b').removeClass('cur')
}
})
$('.nav_leftlist').on('click', 'dl dt', function(event) {
$(this).siblings('dd').toggle()
if($(this).siblings('dd').css('display')=='none'){
$(this).find('b').addClass('cur')
}else{
$(this).find('b').removeClass('cur')
}
})
})
</script>
效果图: