From f764a0b28bae6c312bbe0526d27ebc77cac6a3b0 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E5=BE=A1=E5=AE=85=E7=94=B7?= <530765310@qq.com> Date: Tue, 22 Aug 2023 01:06:44 +0000 Subject: [PATCH] =?UTF-8?q?=E4=BC=98=E5=8C=96=E9=A1=B6=E9=83=A8=E8=8F=9C?= =?UTF-8?q?=E5=8D=95=E8=BF=87=E5=A4=9A=E9=87=87=E7=94=A8=E6=9B=B4=E4=BC=98?= =?UTF-8?q?=E7=9A=84=E5=B1=95=E7=8E=B0=E6=96=B9=E5=BC=8F?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: 御宅男 <530765310@qq.com> --- component/pear/module/menu.js | 83 ++++++++++++++++++++++------------- 1 file changed, 53 insertions(+), 30 deletions(-) diff --git a/component/pear/module/menu.js b/component/pear/module/menu.js index 33cde7f..85cceba 100644 --- a/component/pear/module/menu.js +++ b/component/pear/module/menu.js @@ -57,31 +57,6 @@ layui.define(['table', 'jquery', 'element'], function (exports) { // 处理高度 $("#" + opt.elem).height(option.height) - setTimeout(function () { - $("#" + opt.control + " .control").on("mousewheel DOMMouseScroll", function (event) { - - var delta = (event.originalEvent.wheelDelta && (event.originalEvent.wheelDelta > 0 ? 1 : -1)) || // chrome & ie - (event.originalEvent.detail && (event.originalEvent.detail > 0 ? -1 : 1)); // firefox - - if (delta > 0) { - for (var num = 1; num < 20; num++) { - setTimeout(function () { - if ($("#" + opt.control + " .control ul").css('left').replace("px", "") < 0) { - $("#" + opt.control + " .control ul").css("left", "+=2px"); - } - }, 10) - } - } else if (delta < 0) { - if (((Number)($("#" + opt.control + " .control ul").css("left").replace("px", "")) + ($("#" + opt.control + " .control ul").width() - $("#" + opt.control + " .control").width())) > 0) { - for (var num = 1; num < 20; num++) { - setTimeout(function () { - $("#" + opt.control + " .control ul").css("left", "-=2px"); - }, 10) - } - } - } - }); - }, 1000) return new pearMenu(option); } @@ -322,7 +297,8 @@ layui.define(['table', 'jquery', 'element'], function (exports) { } function createMenuAndControl(option) { - var control = '