查询时反应慢重复点击按钮浮层弹框提示

.datagrid-mask{
	position:absolute;
	left:0;
	top:0;
	width:100%;
	height:100%;
	background:#ccc;
	opacity:0.3;
	filter:alpha(opacity=30);
	display:none;
}
.datagrid-mask-msg{
    position:absolute;
	top:50%;
	margin-top:-20px;
	width:auto;
	height:16px;
	padding:12px 5px 10px 30px;
	/* background:#fff url('img/pagination_loading.gif') no-repeat scroll 5px 10px;
	border:2px solid #6593CF; */
	color:#222;
	display:none;
}

//添加浮层提示
function AddRunningDiv() {
    $("<div class=\"datagrid-mask\"></div>").css({ display: "block", width: "100%",             
    height: $(document).height() }).appendTo("body");
    $("<div class=\"datagrid-mask-msg\"></div>").html("正在处理,请稍                       
    候...").appendTo("body").css({ display: "block", left: 
    ($(document.body).outerWidth(true) - 190) / 2, top: ($(document).height() - 280)});
} 
//内容显示移除提示
function MoveRunningDiv() {
    $("div[class='datagrid-mask']").remove();
    $("div[class='datagrid-mask-msg']").remove();
}
​
//定义全局标记点击按钮次数
var clickflag = true;
$("#btnBg").click(function(){
    if (!clickflag){ 
        AddRunningDiv();
		return; 
	}else{
		clickflag = false;
		//执行查询
}

猜你喜欢

转载自blog.csdn.net/qq_36854073/article/details/81195629