demo.html 2.82 KB
<!doctype html>
<html>
<head>
<meta charset="utf-8">
<title>求师问学</title>
<!--for-mobile-app-->
<meta content="yes" name="apple-mobile-web-app-capable">
<meta content="yes" name="apple-touch-fullscreen">
<meta content="black" name="apple-mobile-web-app-status-bar-style">
<meta content="telephone=no,email=no" name="format-detection">
<meta name="viewport" content="initial-scale=1, maximum-scale=1, minimum-scale=1, user-scalable=no">
<!--common-->
<script src="../jquery-1.8.3.min.js"></script>
</head>

<body class="bg-white">

<button onClick="loadingNoMsg()">loading(no-msg)</button>
<button onClick="loading()">loading</button>
<button onClick="success()">success</button>
<button onClick="error()">error</button>

<link href="AlerBottom.css" rel="stylesheet"/>
<script src="AlerBottom.js"></script>    

<script>

function loading(){
	$.AlerBottom({
		status:'loading',         //状态
		msg:'保存中..',           //文字0
		duration:null,
		callback:function(){
		}
	})
	setTimeout(function(){
		$.AlerBottom({
			status:'loadingEnd',              //显示或隐藏,默认为show
			time:1000,
			duration:null,
			callback:function(){
				$.AlerBottom({
					status:'success',
					msg:'保存成功,正在为您跳转(5)',
					duration:null
				})
				var leftTime=5;
				setInterval(function(){
					if(leftTime==0){
						//window.location.href="http://www.baidu.com";
					}else{
						leftTime--
						$('#AlerBottom .info').text('保存成功,正在为您跳转('+leftTime+')');
					}
				},1000)
			}
		})
		
		/*$.AlerBottom({
			status:'success',              //显示或隐藏,默认为show
			time:0 
		})*/
	},2000)
	
}
function loadingNoMsg(){
	$.AlerBottom({
		status:'loading',         //状态
		duration:null,
		callback:function(){
		}
	})
	setTimeout(function(){
		$.AlerBottom({
			status:'loadingEnd',              //显示或隐藏,默认为show
			time:1000,
			duration:null,
			callback:function(){
				$.AlerBottom({
					status:'success',
					msg:'保存成功,正在为您跳转(5)',
					duration:null
				})
				var leftTime=5;
				setInterval(function(){
					if(leftTime==0){
						//window.location.href="http://www.baidu.com";
					}else{
						leftTime--
						$('#AlerBottom .info').text('保存成功,正在为您跳转('+leftTime+')');
					}
				},1000)
			}
		})
		
		/*$.AlerBottom({
			status:'success',              //显示或隐藏,默认为show
			time:0 
		})*/
	},2000)
	
}

function error(){
	$.AlerBottom({
		status:'error',         //状态
		msg:'保存失败保存失败保存失败保存失败保存失败保存失败保存失败保存失败保存失败保存失败保存失败保存失败保存失败保存失败!',           //文字0
		duration:null
	})
}

function success(){
	$.AlerBottom({
		status:'success',
		msg:'保存成功!',
		duration:null
	})
}
</script>
</body>
</html>