From 59fee28170b4cc721e39695c83cd55e076c11748 Mon Sep 17 00:00:00 2001 From: fay Date: Wed, 1 Aug 2018 11:37:29 +0800 Subject: [PATCH] =?UTF-8?q?mouseInBounds=E6=96=B9=E6=B3=95=E4=BF=AE?= =?UTF-8?q?=E6=94=B9?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/core/func/dom.js | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/src/core/func/dom.js b/src/core/func/dom.js index 2b8e2e7a0..08ad22d6e 100644 --- a/src/core/func/dom.js +++ b/src/core/func/dom.js @@ -119,9 +119,11 @@ BI.extend(jQuery.fn, { }, __isMouseInBounds__: function (e) { - var offset2Body = this.offset(); - return !(e.pageX < offset2Body.left || e.pageX > offset2Body.left + this.outerWidth() - || e.pageY < offset2Body.top || e.pageY > offset2Body.top + this.outerHeight()); + var offset2Body = this.get(0).getBoundingClientRect ? this.get(0).getBoundingClientRect() : this.offset(); + var width = offset2Body.width || this.outerWidth(); + var height = offset2Body.height || this.outerHeight(); + return !(e.pageX < offset2Body.left || e.pageX > offset2Body.left + width + || e.pageY < offset2Body.top || e.pageY > offset2Body.top + height); }, __hasZIndexMask__: function (zindex) {