62,242
社区成员




<asp:Button ID="btnRefresh" runat="server" Text="刷新" CssClass="btnRefresh" onmousedown="this.className='btnRefreshDown';" onmouseout="this.className='btnRefresh';" onmouseover="this.className='btnRefreshOver';"/>
.btnRefresh
{
cursor: pointer;
padding-left:25px;
padding-top:3px;
font-size: 12px;
background: transparent;
border: 0px;
width: 71px;
height: 26px;
background-image: url(/Images/Button/Refresh.gif);
background-repeat: no-repeat;
}
.btnRefreshOver
{
cursor: pointer;
padding-left:25px;
padding-top:3px;
font-size: 12px;
background: transparent;
border: 0px;
width: 71px;
height: 26px;
background-image: url(/Images/Button/RefreshOver.gif);
background-repeat: no-repeat;
}
.btnRefreshDown
{
cursor: pointer;
padding-left:25px;
padding-top:3px;
font-size: 12px;
background: transparent;
border: 0px;
width: 71px;
height: 26px;
background-image: url(/Images/Button/RefreshDown.gif);
background-repeat: no-repeat;
}
<asp:Button ID="btnRefresh" runat="server" Text="刷新" CssClass="btnRefresh" />
<script >
SetCss("btnRefresh");
function SetCss(cid)
{
var obj = document.getElementById(cid);
if(document.all)
{
obj.attachEvent("onmouseover",function(){obj.className='btnRefreshOver'});
obj.attachEvent("onmouseout",function(){obj.className='btnRefresh'});
obj.attachEvent("onmousedown",function(){obj.className='btnRefreshDown'});
}else
{
obj.addEventListener("mouseover",function(){obj.className='btnRefreshOver'},false);
obj.addEventListener("mouseout",function(){obj.className='btnRefresh'},false);
obj.addEventListener("mousedown",function(){obj.className='btnRefreshDown'},false);
}
}
</script>