div居中显示 div弹出框 alert(渐渐消失)

先看效果

前台代码

<% @ Page Language = " C# "  AutoEventWireup = " true "  CodeFile = " div弹出居中.aspx.cs "  Inherits = " div弹出居中 "   %>

<! DOCTYPE html PUBLIC  " -//W3C//DTD XHTML 1.0 Transitional//EN "   " http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd " >
< html xmlns = " http://www.w3.org/1999/xhtml " >
< head runat = " server " >
    
< title > 无标题页 </ title >

    
< script src = " scripts/jquery-1.3.2.min.js "  type = " text/javascript " ></ script >

    
< script language = " javascript "  type = " text/javascript " >
function divcenter(i)
{
var divId
= document.getElementById( ' div1sss ' );
document.getElementById(
' div1sss ' ).innerHTML = i;
document.getElementById(
" div1sss " ).style.display = " block " ;
 $(
" #div1sss " ).fadeOut( 13000 ,function(){}); 

}

function attachWindowEventHandler(
event ,func)
  {
    
if (navigator.appName  ==   ' Netscape '
    {
          window.addEventListener(
event ,func, false ); 
   }
   
else  
   { 
         window.attachEvent(
' onload ' ,func);
   }
 } 
    
</ script >

    
< style type = " text/css " >
        #div1sss
        {
            position: absolute;
            top: 
50 % ;
            left: 
50 % ;
            margin
- top:  - 25px;
            margin
- left:  - 150px;
            color: blue;
            width: 300px;
            height: 50px;
            font
- weight: bold;
            border: solid 1px gray;
            line
- height: 50px;
            font
- size: 20px;
            text
- align: center; </ style >
</ head >
< body >
    
< form id = " form1 "  runat = " server " >
    
< table width = " 100% " >
        
< tr >
            
< td >
                
< asp:Button ID = " Button1 "  runat = " server "  Text = " Button "  OnClick = " Button1_Click "   />
                
< span onclick = " divcenter() " > test </ span >
            
</ td >
        
</ tr >
     
    
</ table >
    
< div id = " div1sss "  style = " display: none; position: absolute; background-color: yellow; " >
    
</ div >
      
</ form >
  
</ body >
</ html >

后台代码

 protected void Button1_Click(object sender, EventArgs e)
    {
        Utility.MessageBox.AlertScript("attachWindowEventHandler('',function(){divcenter('成功');})");
    }

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值