弹出(保存成功)为悬浮框,一秒之后消失

来源:互联网 发布:瑙鲁域名 编辑:程序博客网 时间:2024/06/11 13:29

前台:

1.给个lable控件:<asp:Label ID="lbPrompt" runat="server" Text="Label" Visible="false"></asp:Label>

2.css:

 #lbPrompt
        {
            position: absolute; top:120px; left: 300px; height: 60px; width: 200px;  font-size: 14px; font-weight: bold;
            background: url(../images/bg.jpg) no-repeat;
            color: #444;
            z-index: 9999;
            padding-left: 8px;
            padding-top: 16px;
        }

3.Jquery显示0.8秒之后隐藏(必须引用jquery库)

        <script>

         if ($("#lbPrompt").attr("visible", "true")) {
            setTimeout("$('#lbPrompt').hide();", 800);
         }
        
       </script>

后台:

 当保存成功之后:  

                       this.lbPrompt.Visible = true;
                        lbPrompt.Text = "数据修改成功";

 

 

0 0