12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879 |
- 数据提交 = 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(`
- <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)
- }
|