From 0bce98eec71c9222ef6f18daf3f47987ef0d5153 Mon Sep 17 00:00:00 2001 From: gzy Date: Sat, 2 Apr 2022 17:16:36 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BF=AE=E5=A4=8Dframe=E6=A8=A1=E5=9D=97?= =?UTF-8?q?=E7=9A=84=E5=87=BD=E6=95=B0=E5=8F=82=E6=95=B0=E4=B8=8E=E5=AE=9A?= =?UTF-8?q?=E4=B9=89=E5=8F=98=E9=87=8F=E5=90=8D=E9=87=8D=E5=A4=8D=E9=97=AE?= =?UTF-8?q?=E9=A2=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- component/pear/module/frame.js | 12 +++++------- 1 file changed, 5 insertions(+), 7 deletions(-) diff --git a/component/pear/module/frame.js b/component/pear/module/frame.js index 9e593a9..6b41e0f 100644 --- a/component/pear/module/frame.js +++ b/component/pear/module/frame.js @@ -23,30 +23,28 @@ layui.define(['jquery', 'element'], function (exports) { } pearFrame.prototype.changePage = function (url, loading) { + var $frameLoad = $("#" + this.option.elem).find(".pear-frame-loading"); if (loading) { - var loading = $("#" + this.option.elem).find(".pear-frame-loading"); loading.css({ display: 'block' }); } $("#" + this.option.elem + " iframe").attr("src", url); if (loading) { - var loading = $("#" + this.option.elem).find(".pear-frame-loading"); setTimeout(function () { - loading.fadeOut(500); + $frameLoad.fadeOut(500); }, 800) } } pearFrame.prototype.changePageByElement = function (elem, url, title, loading) { + var $frameLoad = $("#" + elem).find(".pear-frame-loading"); if (loading) { - var loading = $("#" + elem).find(".pear-frame-loading"); - loading.css({ display: 'block' }); + $frameLoad.css({ display: 'block' }); } $("#" + elem + " iframe").attr("src", url); $("#" + elem + " .title").html(title); if (loading) { - var loading = $("#" + elem).find(".pear-frame-loading"); setTimeout(function () { - loading.css({ display: 'none' }); + $frameLoad.css({ display: 'none' }); }, 400) } } -- Gitee