IE7中不显示jQuery Ajax微调器 [英] jQuery Ajax spinner not displaying in IE7

查看:79
本文介绍了IE7中不显示jQuery Ajax微调器的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在尝试在加载AJAX内容时显示ajax微调器.

I am trying to display an ajax spinner when loading AJAX content.

以下代码在Firefox中似乎可以正常工作,但在IE7中却不能正常工作.显示和隐藏微调框的功能已被调用,但浏览器只是不显示它.

The following code appears to work fine in Firefox but not in IE7. The functions to show and hide the spinner are being called but the browser just does not display it.

这是jQuery:

        $.ajax({ 
            url: filterorSearch,
            data: {filterParams: JSON.stringify(filters), requestTime: new Date().getTime()},
            beforeSend: function(){
                showLoadingGraphic();
            },
            complete: function(){
                hideLoadingGraphic();
            },
            success: function(data){
                $("#BreakingNews").html(data);
                GetRelatedarticles();                
            }
        });

    function showLoadingGraphic() {
        alert("show");
        var showSpinner = $('#page-placeholder-wrapper #main-left').prepend('<div id="ajaxLoader"></div>');
        return showSpinner;
    }

    function hideLoadingGraphic() {
        alert("hide");
        var hideSpinner = $('#ajaxLoader').remove();
        return hideSpinner;
    }

以及微调器的关联CSS:

And the associated CSS for the spinner:

#page-placeholder-wrapper #main-left 
{
    position:relative;
    }

#ajaxLoader 
{
    background:rgba(255,255,255,.7) url("../images/icon-ajax-loading.gif") no-repeat center center;
    height:100%;
    left:0;
    position:absolute;
    top:0;
    width:100%;
    z-index:9999;
    }

推荐答案

要让您开始工作,请尝试以下操作:

To get you working try this:

    background: url("../images/icon-ajax-loading.gif") no-repeat center center rgba(255,255,255,.7);

我不知道为什么rgba必须是最后一个!

I don't know why the rgba has to be last!

IE不支持rgba,因此从background:开始它会出错,并且该行的其余部分不会针对css执行

IE does not support rgba, therefore with it starting on background: it errors and the rest of the line isn't executed for the css

请参阅:浏览器对RGBa的支持

这篇关于IE7中不显示jQuery Ajax微调器的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆