您好,欢迎访问一九零五行业门户网

基于HTML5代码实现折叠菜单附源码下载_html5教程技巧

基于html5代码实现折叠菜单附源码下载。效果图如下所示,喜欢的亲们还可以下载源码哦!
效果展示   源码下载
hmtl代码:
复制代码
代码如下:
爱编程
爱编程
jquery特效
css3特效
html5特效
音效下载
flash动画
js代码:
复制代码
代码如下:
(function ($) {
var cards = $('.card-drop'), toggler = cards.find('.toggle'), links = cards.find('ul>li>a'), li = links.parent('li'), count = links.length, width = 100;
li.each(function (i) {
$(this).css('z-index', count - i);
});
function setclosed() {
li.each(function (index) {
$(this).css('top', index * 4).css('width', width - index * 0.5 + '%').css('margin-left', index * 0.25 + '%');
});
li.addclass('closed');
toggler.removeclass('active');
}
setclosed();
toggler.on('mousedown', function () {
var $this = $(this);
if ($this.is('.active')) {
setclosed();
} else {
$this.addclass('active');
li.removeclass('closed');
li.each(function (index) {
$(this).css('top', 60 * (index + 1)).css('width', '100%').css('margin-left', '0px');
});
}
});
links.on('click', function (e) {
var $this = $(this), label = $this.data('label');
icon = $this.children('i').attr('class');
li.removeclass('active');
if ($this.parent('li').is('active')) {
$this.parent('li').removeclass('active');
} else {
$this.parent('li').addclass('active');
}
toggler.children('span').text(label);
toggler.children('i').removeclass().addclass(icon);
setclosed();
e.preventdefault;
});
}(jquery));
其它类似信息

推荐信息