如何在回调中显示进度指示器

时间:2014-03-02 14:05:29

标签: javascript jquery asp.net css css3

我有一个像这样的进度指示器:

HTML代码(在Webform2.aspx中):

<div>
        <div class="spinner">
            <div class="bounce1"></div>
            <div class="bounce2"></div>
            <div class="bounce3"></div>
        </div>
    </div>

和css:

.spinner {
        margin: 100px auto 0;
        width: 70px;
        text-align: center;
    }

        .spinner > div {
            width: 18px;
            height: 18px;
            background-color: #333;
            border-radius: 100%;
            display: inline-block;
            -webkit-animation: bouncedelay 1.4s infinite ease-in-out;
            animation: bouncedelay 1.4s infinite ease-in-out;
            /* Prevent first frame from flickering when animation starts */
            -webkit-animation-fill-mode: both;
            animation-fill-mode: both;
        }

        .spinner .bounce1 {
            -webkit-animation-delay: -0.32s;
            animation-delay: -0.32s;
        }

        .spinner .bounce2 {
            -webkit-animation-delay: -0.16s;
            animation-delay: -0.16s;
        }

    @-webkit-keyframes bouncedelay {
        0%, 80%, 100% {
            -webkit-transform: scale(0.0);
        }

        40% {
            -webkit-transform: scale(1.0);
        }
    }

    @keyframes bouncedelay {
        0%, 80%, 100% {
            transform: scale(0.0);
            -webkit-transform: scale(0.0);
        }

        40% {
            transform: scale(1.0);
            -webkit-transform: scale(1.0);
        }
    }

我将这个脚本写在页面的头部,名称为:Webform2.aspx

 <script>
    $(window).load(function () {

        $('#spinner').fadeout(2000);
    });
</script>

我按名称在另一个页面中有一个按钮:Webform1.aspx,在OnClick()中我有:

   protected void Button1_Click(object sender, EventArgs e)
    {
        Response.Redirect("webform2.aspx");
    }

我希望当用户点击Button1时,它会显示进度指示器,直到Webform1.aspx已加载!我该怎么做?

0 个答案:

没有答案