zoukankan      html  css  js  c++  java
  • jquery提示消息,简单通用

    jquery提示消息。简单通用

    function showTips(txt,time,status)
    		{
    			var htmlCon = '';
    			if(txt != ''){
    				if(status != 0 && status != undefined){
    					htmlCon = '<div class="tipsBox" style="220px;padding:10px;background-color:#4AAF33;border-radius:4px;-webkit-border-radius: 4px;-moz-border-radius: 4px;color:#fff;box-shadow:0 0 3px #ddd inset;-webkit-box-shadow: 0 0 3px #ddd inset;text-align:center;position:fixed;top:25%;left:50%;z-index:999999;margin-left:-120px;"><img src="images/ok.png" style="vertical-align: middle;margin-right:5px;" alt="OK,"/>'+txt+'</div>';
    				}else{
    					htmlCon = '<div class="tipsBox" style="220px;padding:10px;background-color:#D84C31;border-radius:4px;-webkit-border-radius: 4px;-moz-border-radius: 4px;color:#fff;box-shadow:0 0 3px #ddd inset;-webkit-box-shadow: 0 0 3px #ddd inset;text-align:center;position:fixed;top:25%;left:50%;z-index:999999;margin-left:-120px;"><img src="images/err.png" style="vertical-align: middle;margin-right:5px;" alt="Error,"/>'+txt+'</div>';
    				}
    				$('body').prepend(htmlCon);
    				if(time == '' || time == undefined){
    					time = 1500; 
    				}
    				setTimeout(function(){ $('.tipsBox').remove(); },time);
    			}
    		}

    调用代码

    showTips('您的邮箱格式错咯~');

    showTips('提交成功~ 即将进入下一步',2500,1);


  • 相关阅读:
    [LUOGU] 1364 医院设置
    [POJ] 3278 Catch That Cow
    [OpenJudge] 2727 仙岛寻药
    [POJ] 2386 Lake Counting
    [POJ]1118 Lining up
    [LUOGU]1141 01迷宫
    [POJ]1111 Image Perimeters
    python之路——初识函数
    python----------文件操作
    Python中的split()函数的用法
  • 原文地址:https://www.cnblogs.com/cynchanpin/p/6849688.html
Copyright © 2011-2022 走看看