sld()

function sld(bgId,disableBackground)//ShowLoading
{
    CM();
    ShowLoading('<div class="pack_loading_box"><p>正在进行中,请稍等...</p></div>', IsEmpty(bgId) ? null : bgId,disableBackground);

}

============================================================================

CM():

function CM() {
    if (o('alert_div') != null) document.body.removeChild(o("alert_div"));
    if (o('alert_div_MSGBOX') != null) document.body.removeChild(o("alert_div_MSGBOX"));
    if ($.browser.msie && $.browser.version == '6.0')
        ShowSelect(true);
    var bgObj = document.getElementById("bgDiv");
    if (bgObj != null) {
        document.body.removeChild(bgObj);
    }
    if (bgObj != null) {
        bgObj = null;
    }
}


function o(obj) {
    return document.getElementById(obj);
}


//from jquery-ext.js

function ShowSelect(xShow, objId) {
    $('select', objId == null ? null : ('#' + objId)).each(function () {
        if (xShow && this.attributes["hidden"] == null)
            $(this).show();
        else
            $(this).hide();
    });
}

===========================================================

ShowLoading:

function ShowLoading(l, sId, disableLockBackground)//ShowLoading
{
    ShowDiv(l, null, null, "#7ec2e9", "LOADING", 0, 0, sId);
    if (!disableLockBackground)
        ShowBackgroup(sId);
    try {
        if (o('_sldtext') != null) {
            o('_sldtext').focus();
        }
    } catch (e) {
    }
}

//from jquery-ext.js

function ShowDiv(content, width, height, bordercolor, borderstyle) {
    ShowDiv(content, width, height, bordercolor, "", 0, 0);
}


function ShowBackgroup(divId) {
    if (o("bgDiv") != null) return;
    function height() {
        var scrollHeight,
            offsetHeight;
        // handle IE 6
        if ($.browser.msie && $.browser.version < 7) {
            scrollHeight = Math.max(
                document.documentElement.scrollHeight,
                document.body.scrollHeight
            );
            offsetHeight = Math.max(
                document.documentElement.offsetHeight,
                document.body.offsetHeight
            );


            if (scrollHeight < offsetHeight) {
                return $(window).height() + 'px';
            } else {
                return scrollHeight + 'px';
            }
            // handle "good" browsers
        } else {
            return $(document).height() + 'px';
        }
    }


    function width() {
        var scrollWidth,
            offsetWidth;
        // handle IE
        if ($.browser.msie) {
            scrollWidth = Math.max(
                document.documentElement.scrollWidth,
                document.body.scrollWidth
            );
            offsetWidth = Math.max(
                document.documentElement.offsetWidth,
                document.body.offsetWidth
            );


            if (scrollWidth < offsetWidth) {
                return $(window).width() + 'px';
            } else {
                return scrollWidth + 'px';
            }
            // handle "good" browsers
        } else {
            return $(document).width() + 'px';
        }
    }


    var postion = { "left": "0px", "top": "0px", "width": 0, "height": 0 };
    //var opacity = 0.8;
    function getPix(pixel) {
        pixel = pixel.indexOf('px') > -1 ? pixel.replace('px', '') : pixel;
        var num = parseFloat(pixel, 10);
        return isNaN(num) ? 0 : num;
    }


    if (divId != null && o(divId) != null) {
        var objPositoion = $(o(divId)).offset();
        //var marginTop = getPix($(o(divId)).css('margin-top')) + getPix($(o(divId)).css('padding-top'));
        //var marginLeft = getPix($(o(divId)).css('margin-left')) + getPix($(o(divId)).css('padding-left'));
        //postion.top = (objPositoion.top + marginTop) + 'px';
        //postion.left = (objPositoion.left + marginLeft) + 'px';
        //postion.height = ($(o(divId)).innerHeight() - ($(o(divId)).innerHeight() - $(o(divId)).height()) / 2 - marginTop) + 'px';
        //postion.width = $(o(divId)).width() + 'px';


        postion.top = objPositoion.top;
        postion.left = objPositoion.left;
        postion.height = $(o(divId)).outerHeight();
        postion.width = $(o(divId)).outerWidth();


        opacity = 0.25;
    } else {
        postion.height = height();
        postion.width = width();
    }
    var bgObj = document.createElement("div");
    bgObj.id = 'bgDiv';
    $(bgObj).css({ "left": postion.left, "top": postion.top, "width": postion.width, "height": postion.height });
    bgObj.className = "modalBackground";
    //bgObj.style.zIndex = "100";
    //bgObj.style.opacity = opacity;
    //if (!($.browser.msie && parseInt($.browser.version, 10) > 8))
    // bgObj.style.filter = "progid:DXImageTransform.Microsoft.Alpha(style=3,opacity=25,finishOpacity=15)";
    if ($.browser.msie && $.browser.version < 7) {
        $(bgObj).prepend($('<iframe src="javascript:false;document.write(\'\');"></iframe>').css({ opacity: 0 }).css({ width: postion.width, height: postion.height }));
        ShowSelect(false);
    }
    document.body.appendChild(bgObj);
}

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值