From 8cff7d490a22ee7df9deb77c31c27d815439028a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E5=B0=B1=E7=9C=A0=E4=BB=AA=E5=BC=8F?= <854085467@qq.com> Date: Sat, 25 Jul 2020 14:57:08 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BC=98=E5=8C=96=E8=8F=9C=E5=8D=95=E4=B8=8B?= =?UTF-8?q?=E6=8B=89=E6=95=88=E6=9E=9C?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- component/pear/module/menu.js | 13 +++---------- 1 file changed, 3 insertions(+), 10 deletions(-) diff --git a/component/pear/module/menu.js b/component/pear/module/menu.js index 54a6792..4ccd4c7 100644 --- a/component/pear/module/menu.js +++ b/component/pear/module/menu.js @@ -429,33 +429,26 @@ layui.define(['table', 'jquery', 'element'], function(exports) { function downShow(option) { $("body #" + option.elem).on("click", "a[menu-type='0']", function() { - if (!$("#" + option.elem).is(".pear-nav-mini")) { - var superEle = $(this).parent(); var ele = $(this).next('.layui-nav-child'); - var height = ele.height(); + var heights = ele.children("dd").length * 40; + if ($(this).parent().is(".layui-nav-itemed")) { - if (option.accordion) { $(this).parent().parent().find(".layui-nav-itemed").removeClass("layui-nav-itemed"); $(this).parent().addClass("layui-nav-itemed"); } - ele.height(0); - ele.animate({ - height: height + "px" + height: heights + "px" }, 200, function() { ele.css({ height: "auto" }); }); - } else { - $(this).parent().addClass("layui-nav-itemed"); - ele.animate({ height: "0px" }, 200, function() {