From fa7e941db2b807c01c0f46edabe6a8f195b456fe Mon Sep 17 00:00:00 2001 From: dengbw Date: Thu, 23 Sep 2021 17:56:55 +0800 Subject: [PATCH] admin_orders_923_2 --- admin/views/receiver/orders/get.php | 54 ++++++++++++++++++++++++++++- 1 file changed, 53 insertions(+), 1 deletion(-) diff --git a/admin/views/receiver/orders/get.php b/admin/views/receiver/orders/get.php index f50f62b3..e9dd49b7 100644 --- a/admin/views/receiver/orders/get.php +++ b/admin/views/receiver/orders/get.php @@ -453,7 +453,59 @@ } } }); - }) + }); + //图片放大缩小 + $(document).on("mousewheel DOMMouseScroll", ".layui-layer-phimg", function (e) { + var delta = (e.originalEvent.wheelDelta && (e.originalEvent.wheelDelta > 0 ? 1 : -1)) || // chrome & ie + (e.originalEvent.detail && (e.originalEvent.detail > 0 ? -1 : 1)); // firefox + var imagep = $(".layui-layer-phimg").parent().parent(); + var image = $(".layui-layer-phimg").parent(); + var h = image.height(); + var w = image.width(); + var img_url = $("#imglayer").attr("src"); + // 创建对象 + var img = new Image(); + // 改变图片的src + img.src = img_url; + var width = img.width; + var height = img.height; + debugger; + if (delta > 0) { + if (h < (window.innerHeight)) { + h = h * 1.05; + w = w * 1.05; + width = width*1.05; + height = height*1.05; + } + } else if (delta < 0) { + if (h > 100) { + h = h * 0.95; + w = w * 0.95; + width = width*0.95; + height = height*0.95; + } + } + imagep.css("top", (window.innerHeight - h) / 2); + imagep.css("left", (window.innerWidth - w) / 2); + image.height(h); + image.width(w); + imagep.height(h); + imagep.width(w); + var current = $("#current").val(); + if((current/90)%2==1){ + $('#imglayer').css("width",h); + $('#imglayer').css("margin-top",-(w-h)/2); + if(height