Browse Source

更新 'login_html.js'

WXT往昔 3 years ago
parent
commit
68c18d477e
1 changed files with 85 additions and 0 deletions
  1. 85 0
      login_html.js

+ 85 - 0
login_html.js

@@ -1,5 +1,90 @@
 $(document).ready(function () {
   
+  数据提交 = function(name = '地址',json = '数据',result = '回调') {
+    $.post('http://localhost:13131/'+name,json,function(data){
+        result(data);
+    })
+}
+
+滑动显示 = function (table1 = '标签一',time = '时间') {
+    $(table1).css({
+        overflow:'hidden',
+        cursor:'pointer',
+    }).find('div').css({
+        width:$(table1).width(),
+        height:$(table1).height(),
+        background:'rgba(44,62,80,.4)',
+        marginTop:$(table1).height()-$(table1).find('span').height(),
+        cursor:'pointer',
+    }).find('*').css({
+        width:$(table1).width(),
+        color:'#FFF',
+        margin:'5px',
+        textAlign:'left',
+    });
+    $(table1).hover(function(){
+        $(this).find('div').animate({
+            marginTop:'0px',
+        },time)
+    },function(){
+        $(this).find('div').animate({
+            marginTop:$(this).height()-$(this).find('span').height(),
+        },time);
+    });
+}
+
+
+text_each_add = function (id,value) {
+
+    function add_text(table){
+        let i = 0;
+        let interval = setInterval(function () {
+            if (i === value.length){
+                table.innerText = ' ';
+                i=0;
+            }
+            table.append(value[i])
+            i++;
+        },100)
+    }
+
+    let if_id = setInterval(function(){
+        if(document.getElementById(id) !== null){
+            add_text(document.getElementById(id));
+            clearInterval(if_id);
+        }
+    },100)
+}
+
+
+
+
+
+alert_s = function(value = '类容'){
+    $('body').append(`
+<div id="alert" style="background:transparent;
+left:0px;
+right:0px;
+top:0px;
+bottom:0px;
+margin:auto;
+text-align: center;
+position:fixed;
+z-index:999999;">
+
+<div style="text-align: center;position:absolute;
+    left:0px;right:0px;top:0px;bottom:0px;margin:auto;
+    width:150px;height:35px;border-radius:5px;background: rgba(0,0,0,0.3)">
+        <span style="height:35px;line-height:35px;color: #ffffff;font-size: 13px">${value}</span>
+    </div>
+</div>`);
+
+    setTimeout(function () {
+        $('#alert').remove();
+    },500)
+}
+
+//---------------------------------------------------------------------------------------------- 
         Vue.component('login',{
             template:`
     <div type="login" v-on:click="on.button.exit()" v-bind:style="style.box" align="center">