From cdf343f4b4fdabda7b33993a25d9c567926608ae Mon Sep 17 00:00:00 2001 From: nanhaoluo <3075912108@qq.com> Date: Fri, 16 Jan 2026 21:08:49 +0800 Subject: [PATCH] =?UTF-8?q?fix:=20=E6=B7=BB=E5=8A=A0=20jQuery=20easing=20?= =?UTF-8?q?=E5=87=BD=E6=95=B0=E5=A4=87=E7=94=A8=E5=AE=9A=E4=B9=89?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit - 添加 easeOutCirc 和 easeOutExpo 备用实现 - 防止其他插件加载的 jQuery 覆盖 argon_js_merged 中的 easing 插件 - 解决 'n.easing[this.easing] is not a function' 错误 --- argontheme.js | 15 +++++++++++++++ 1 file changed, 15 insertions(+) diff --git a/argontheme.js b/argontheme.js index f93104a..66251b2 100644 --- a/argontheme.js +++ b/argontheme.js @@ -30,6 +30,21 @@ if (typeof window.Zoomify === 'undefined') { // 确保 jQuery 插件存在 if (typeof jQuery !== 'undefined') { (function($) { + // 确保 easing 函数存在(防止其他插件覆盖 jQuery 后丢失) + if (typeof $.easing === 'undefined') { + $.easing = {}; + } + if (typeof $.easing.easeOutCirc === 'undefined') { + $.easing.easeOutCirc = function(x) { + return Math.sqrt(1 - Math.pow(x - 1, 2)); + }; + } + if (typeof $.easing.easeOutExpo === 'undefined') { + $.easing.easeOutExpo = function(x) { + return x === 1 ? 1 : 1 - Math.pow(2, -10 * x); + }; + } + // 确保 zoomify 插件存在 if (typeof $.fn.zoomify === 'undefined') { $.fn.zoomify = function() { return this; };