jQuery.extend({
openloading: function (options) {
var defaults = { msg: '数据提交中...', img: 'loading.gif' };
var opts = $.extend(defaults, options);
$("body").append("<div class='l_overlay' style='position:fixed;top:0;right:0;bottom:0;left:0;z-index:998;width:100%;height:100%;padding:0 20px 0 0;background-color:gray;display:none;'></div><div class='l_showbox' style='position:fixed;top:0;left:50%;z-index:1001;opacity:0;filter:alpha(opacity=0);margin-left:-80px;border:1px solid gray;font-size:12px;font-weight:bold;'><div class='loadingWord' style='width:122px;height:38px;line-height:38px;border:2px solid #D6E7F2;background:#fff;'><img style='margin:10px 8px 10px 8px;float:left;display:inline;' src='"+opts.img+"'>数据提交中...</div></div>");
var h = $(document).height();
$(".l_overlay").css({ "height": h, 'display': 'block', 'opacity': '0.4' });
$(".l_showbox").stop(true).animate({ 'margin-top': (h / 2 - 58) + 'px', 'opacity': '1' }, 200);
},
closeloading: function () {
$(".l_showbox").stop(true).animate({ 'margin-top': '250px', 'opacity': '0' }, 400);
$(".l_overlay").css({ 'display': 'none', 'opacity': '0' });
$(".l_overlay").remove();
$(".l_showbox").remove();
}
});
protected override void OnPreRender(EventArgs e)
{
if (Page != null && !string.IsNullOrEmpty(TargetID))
{
TargetID = GetClientID(TargetID);
Page.ClientScript.RegisterClientScriptResource(typeof(Loading), "BoControl.Scripts.Jquery.js");
this.Page.ClientScript.RegisterStartupScript(typeof(string), "BoControl_" + this.ClientID, "$("#" + TargetID + "").on("click",function(){$.openloading({msg:"" + Text + "", img: "" +Page.ClientScript.GetWebResourceUrl(this.GetType(), "BoControl.Images.loading.gif")+ ""});});", true);
}
base.OnPreRender(e); }
/// <summary>
/// 打开加载动画
/// UpdatePanel注册
/// </summary>
/// <param name="panel">UpdatePanel对象</param>
public void Open(UpdatePanel panel)
{
if (Page != null)
{
ScriptManager.RegisterStartupScript(panel, panel.GetType(), "openloading", "$.openloading({msg:"" + Text + "", img: "" + Page.ClientScript.GetWebResourceUrl(this.GetType(), "BoControl.Images.loading.gif"); + ""});", true);
}
}
机械节能产品生产企业官网模板...
大气智能家居家具装修装饰类企业通用网站模板...
礼品公司网站模板
宽屏简约大气婚纱摄影影楼模板...
蓝白WAP手机综合医院类整站源码(独立后台)...苏ICP备2024110244号-2 苏公网安备32050702011978号 增值电信业务经营许可证编号:苏B2-20251499 | Copyright 2018 - 2025 源码网商城 (www.ymwmall.com) 版权所有