From 31520a7b9a41681fe5c23853643c84bb507488db Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E6=9D=A8=E4=B8=B9=E5=8D=8E?= <14641717+yang-danhua@user.noreply.gitee.com> Date: Mon, 19 May 2025 16:27:55 +0800 Subject: [PATCH] =?UTF-8?q?=E8=A7=86=E9=A2=91=E7=82=B9=E5=87=BB=E9=97=AE?= =?UTF-8?q?=E9=A2=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/index/view/product/detail.html | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) diff --git a/app/index/view/product/detail.html b/app/index/view/product/detail.html index 1a826528..30d57490 100644 --- a/app/index/view/product/detail.html +++ b/app/index/view/product/detail.html @@ -304,8 +304,15 @@ } }); /*图片放大效果*/ - $(".bigImg").click(function () { - $(".enlarge-img").show(); + $(".bigImg").click(function() { + // 判断容器内是否存在视频元素 + if ($(this).find("video").length > 0) { + // 若存在视频,不执行任何操作 + return; + } else if ($(this).find("img").length > 0) { + // 若存在图片,显示放大图片层 + $(".enlarge-img").show(); + } }); $(".enlarge-img .close").click(function () { $(".enlarge-img").hide();