数据提交 = function(name = '地址',json = '数据',result = '回调') { $.post('http://localhost:13131/'+name,json,function(data){ result(data); }) } 文字渐显_循环 = function (table = '标签',value = '内容',time = '时间') { let i = 0; setInterval(function () { if (i === value.length){ $(table).empty(); i=0; } $(table).append(value[i]); i++; },time); } 文字渐显_单次 = function (table = '标签',value = '内容',time = '时间') { let i = 0; let j = setInterval(function () { if (i === value.length){ clearInterval(j); } $(table).append(value[i]); i++; },time); } 滑动显示 = 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); }); } alert_s = function(value = '类容'){ $('body').append(`
${value}
`); setTimeout(function () { $('#alert').remove(); },500) }