浏览代码

Update admin.js

邹景立 3 年之前
父节点
当前提交
d2c4a6554f
共有 1 个文件被更改,包括 6 次插入5 次删除
  1. 6 5
      public/static/admin.js

+ 6 - 5
public/static/admin.js

@@ -999,15 +999,16 @@ $(function () {
         });
     });
 
-    /*! 注册 data-tips-image Hover 事件 */
+    /*! 注册 data-tips-hover 事件行为 */
     onEvent('mouseenter', '[data-tips-image][data-tips-hover]', function () {
         var img = new Image(), that = this, layidx;
         img.referrerPolicy = 'no-referrer', img.style.maxWidth = '260px', img.style.maxHeight = '260px';
         img.src = this.dataset.tipsImage || this.dataset.lazySrc || this.src, img.onload = function () {
-            layidx = layer.tips(img.outerHTML, that, {time: 0, skin: 'layui-layer-image', anim: 5, isOutAnim: false, scrollbar: false});
-        }, $(this).off('mouseleave').on('mouseleave', function () {
-            layui.layer.close(layidx);
-        });
+            layidx = layer.tips(img.outerHTML, that, {time: 0, skin: 'layui-layer-image', anim: 5, scrollbar: false});
+            $(that).off('mouseleave').on('mouseleave', function () {
+                layui.layer.close(layidx);
+            });
+        }
     });
 
     /*! 注册 data-tips-image 事件行为 */