Explorar o código

增加小弹窗

ChenLiang %!s(int64=4) %!d(string=hai) anos
pai
achega
7fce130aad
Modificáronse 1 ficheiros con 26 adicións e 0 borrados
  1. 26 0
      插件/common.js

+ 26 - 0
插件/common.js

@@ -327,6 +327,32 @@ var comm = {
         inner.style.top = -a + "px";
     },
 
+    tips: function (text, time) {
+        time = time ? time : 1500;
+        var para = document.createElement("div"); //创建新的<p> 元素
+        para.innerHTML = text;
+        para.style.zIndex = 10000;
+        para.style.borderRadius = '9px'
+        para.style.backgroundColor = '#287AFF'
+        para.style.textAlign = 'center'
+        para.style.color = '#FFF'
+        para.style.position = 'absolute'
+        para.style.fontSize = '20px'
+        para.style.left = '450px'
+        para.style.top = '250px'
+        para.style.padding = '7px 27px'
+        para.style.width = '380px'
+        para.style.wordBreak = 'break-all'
+        para.style.display = 'block'
+        document.body.appendChild(para);
+    
+
+        setTimeout(function () {
+            document.body.removeChild(para);
+        }, time);
+    },
+
+    /* ====================================================================================== */
 
     STBUtil: {
         /**