html+css3+jquery垂直渐隐显示多级下拉特效

 时间:2024-10-15 13:58:20

1、新建html文档。

html+css3+jquery垂直渐隐显示多级下拉特效

3、初始化css代码。<style>html, body, div, span, applet, object, ifra罪焐芡拂me, h1, h2, h3, h4, h5, h6, p, blockquote, pre, a, abbr, acronym, address, big, cite, code, del, dfn, em, img, ins, kbd, q, s, samp, small, strike, strong, sub, sup, tt, var, b, u, i, center, dl, dt, dd, ol, ul, li, fieldset, form, label, legend, table, caption, tbody, tfoot, thead, tr, th, td, article, aside, canvas, details, embed, figure, figcaption, footer, header, hgroup, menu, nav, output, ruby, section, summary, time, mark, audio, video { margin: 0; padding: 0; border: 0; font-size: 100%; font: inherit; vertical-align: baseline; }article, aside, details, figcaption, figure, footer, header, hgroup, menu, nav, section, main { display: block; }body { line-height: 1; }ol, ul { list-style: none; }blockquote, q { quotes: none; }blockquote:before, blockquote:after, q:before, q:after { content: ''; content: none; }table { border-collapse: collapse; border-spacing: 0; }</style>

html+css3+jquery垂直渐隐显示多级下拉特效

5、书写并添加js代码。<script src="js/modernizr.js"></script><script src="js/jquery-2.1.1.min.js"></script><script>jQuery(document).ready(function(){ var accordionsMenu = $('.cd-accordion-menu'); if( accordionsMenu.length > 0 ) { accordionsMenu.each(function(){ var accordion = $(this); accordion.on('change', 'input[type="checkbox"]', function(){ var checkbox = $(this); console.log(checkbox.prop('checked')); ( checkbox.prop('checked') ) ? checkbox.siblings('ul').attr('style', 'display:none;').slideDown(300) : checkbox.siblings('ul').attr('style', 'display:block;').slideUp(300); }); }); }});</script>

html+css3+jquery垂直渐隐显示多级下拉特效

7、查看效果。

html+css3+jquery垂直渐隐显示多级下拉特效
  • html+css3+jquery兼容手机的全屏导航下拉特效
  • html+css3+jQuery手机端下拉动画时间轴
  • html+css3+jquery左侧悬浮定位显示导航
  • html+css3+jQuery双色球随机选号特效
  • 热门搜索
    京酱肉丝家常做法 褶怎么读 冰激凌的做法 玉米粉的做法大全 菽怎么读 红豆包的做法 包子皮的做法 炒饼的做法 老鸭汤的做法大全 酸辣包菜的做法