日韩性视频-久久久蜜桃-www中文字幕-在线中文字幕av-亚洲欧美一区二区三区四区-撸久久-香蕉视频一区-久久无码精品丰满人妻-国产高潮av-激情福利社-日韩av网址大全-国产精品久久999-日本五十路在线-性欧美在线-久久99精品波多结衣一区-男女午夜免费视频-黑人极品ⅴideos精品欧美棵-人人妻人人澡人人爽精品欧美一区-日韩一区在线看-欧美a级在线免费观看

歡迎訪問 生活随笔!

生活随笔

當(dāng)前位置: 首頁 > 前端技术 > HTML >内容正文

HTML

html5折叠卡片,基于HTML5折叠卡片式下拉菜单代码

發(fā)布時(shí)間:2025/3/8 HTML 18 豆豆
生活随笔 收集整理的這篇文章主要介紹了 html5折叠卡片,基于HTML5折叠卡片式下拉菜单代码 小編覺得挺不錯(cuò)的,現(xiàn)在分享給大家,幫大家做個(gè)參考.

基于HTML5折疊卡片式下拉菜單代碼。這是一款基于jQuery+CSS3+HTML5實(shí)現(xiàn)的下拉列表框特效代碼。效果圖如下:

實(shí)現(xiàn)的代碼。

hmtl代碼:

愛編程

  • 愛編程

  • jQuery特效

  • CSS3特效

  • HTML5特效

  • 音效下載

  • flash動(dòng)畫

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));

總結(jié)

以上是生活随笔為你收集整理的html5折叠卡片,基于HTML5折叠卡片式下拉菜单代码的全部內(nèi)容,希望文章能夠幫你解決所遇到的問題。

如果覺得生活随笔網(wǎng)站內(nèi)容還不錯(cuò),歡迎將生活随笔推薦給好友。