<style>
.accordion {
width: 100%;
background: #FFF;
-webkit-border-radius: 4px;
-moz-border-radius: 4px;
border-radius: 4px;
padding: 20px;
box-sizing: border-box;
}
.accordion .link {
cursor: pointer;
display: block;
padding: 15px 15px 15px 15px;
color: #4D4D4D;
font-size: 14px;
font-weight: 700;
border-bottom: 1px solid #eee;
position: relative;
-webkit-transition: all 0.4s ease;
-o-transition: all 0.4s ease;
transition: all 0.4s ease;
}
.accordion .link a {
color: #000;
}
.accordion .link:hover {
background: #eee;
color: #4c6ef5;
}
.accordion li {
list-style: none;
}
.accordion li:last-child .link {
border-bottom: 0;
}
.accordion li i {
position: absolute;
top: 16px;
left: 12px;
font-size: 18px;
color: #595959;
-webkit-transition: all 0.4s ease;
-o-transition: all 0.4s ease;
transition: all 0.4s ease;
}
.accordion li i.fa-chevron-down {
right: 12px;
left: auto;
font-size: 16px;
}
.accordion li.open .link a {
color: #4c6ef5;
}
.accordion li.open i {
color: #4c6ef5;
}
.accordion li.open i.fa-chevron-down {
-webkit-transform: rotate(180deg);
-ms-transform: rotate(180deg);
-o-transform: rotate(180deg);
transform: rotate(180deg);
}
.accordion li .link {
background: url(/static/reso/image/up.png) center right no-repeat !important;
}
.accordion .open .link {
background: url(/static/reso/image/down.png) center right no-repeat !important;
}
/**
* Submenu
-----------------------------*/
.submenu {
display: none;
background: #f8f9fa;
font-size: 14px;
}
.submenu li {
border-bottom: 1px solid #eee;
}
.submenu a {
display: block;
text-decoration: none;
color: #000;
padding: 12px;
padding-left: 42px;
-webkit-transition: all 0.25s ease;
-o-transition: all 0.25s ease;
transition: all 0.25s ease;
}
.submenu a:hover {
background: #fff;
color: #4c6ef5;
}
.openBox {
display: block;
}
.openA {
background: #fff;
color: #4c6ef5 !important;
font-weight: 600;
}
.open .link {
background: #eee;
color: #4c6ef5;
}
.menu_head {
background: none !important;
}
</style>
<div style=" background: #fff;padding-top:20px;">
<a class="menu_head"
style="padding-left: 0;color: #4c6ef5;font-size: 20px;letter-spacing: 2px;display: block;font-weight: 600;text-align: center;"
href={dr_share_cat_value(9, 'url' )}>
产品中心
</a>
</div>
<div id="firstpane" class="menu_list accordion">
{category module=share pid=1}
<li {if IS_SHARE && $catid && dr_in_array($catid, $t.catids)} class="open" {/if}>
<div class="link"><a href="{$t.url}">{$t.name}</a></div>
<ul class="submenu {if IS_SHARE && $catid && dr_in_array($catid, $t.catids)} openBox {/if}">
{category module=share pid=$t.id return=t1}
<li><a href="{$t1.url}" {if IS_SHARE && $catid && dr_in_array($catid, $t1.catids)} class="openA"
{/if}>{$t1.name}</a></li>
{/category}
</ul>
</li>
{/category}
<script>
$(function () {
var Accordion = function (el, multiple) {
this.el = el || {};
this.multiple = multiple || false;
// Variables privadas
var links = this.el.find('.link');
// Evento
links.on('click', { el: this.el, multiple: this.multiple }, this.dropdown)
}
Accordion.prototype.dropdown = function (e) {
var $el = e.data.el;
$this = $(this),
$next = $this.next();
$next.slideToggle();
$this.parent().toggleClass('open');
if (!e.data.multiple) {
$el.find('.submenu').not($next).slideUp().parent().removeClass('open');
};
}
var accordion = new Accordion($('#firstpane'), false);
});
</script>
</div>
作者:ZhiChao.Cui
1. 本网站部分内容可能来源于网络,仅供大家学习与参考,如有侵权,请联系站长(1511545254@qq.com)进行删除处理,承诺将在一个工作日内及时进行改正。
2. 本网站一切内容不代表本站立场,且并不代表本站赞同其观点和对其真实性负责。