方法一: javascript


方法二:C#样式的改变
ImageButton的图片变换的效果
btn.Attributes.Add("class","button");  
  btn.Attributes.Add("onmouseover","this.className='buttonover'");  
  btn.Attributes.Add("onmouseout","this.className='buttonout'");  
  CSS里面对应的部分:  
  .button{width:100;   height:20;BACKGROUND:   url("/AppBaGang/images/button/button_v3.gif")   repeat-y;   border:0   solid   silver;   COLOR:   #ffffff;   FONT-SIZE:   9pt;   FONT-STYLE:   normal;   FONT-VARIANT:   normal;   FONT-WEIGHT:   normal;   LINE-HEIGHT:   normal}  
   
  .buttonover{width:100;   height:20;BACKGROUND:   url("/AppBaGang/images/button/button_v4.gif")   repeat-y;   border:0   solid   silver;   COLOR:   #ffffff;   FONT-SIZE:   9pt;   FONT-STYLE:   normal;   FONT-VARIANT:   normal;   FONT-WEIGHT:   normal;   LINE-HEIGHT:   normal}  
   
  .buttonout{width:100;   height:20;BACKGROUND:   url("/AppBaGang/images/button/button_v3.gif")   repeat-y;   border:0   solid   silver;   COLOR:   #ffffff;   FONT-SIZE:   9pt;   FONT-STYLE:   normal;   FONT-VARIANT:   normal;   FONT-WEIGHT:   normal;   LINE-HEIGHT:   normal}   
   
方法三 最简单的:
btnNew.Attributes.Add("onmouseover",   "this.src='../Imgs/new_over.gif'");  
  btnNew.Attributes.Add("onmouseout",   "this.src='../Imgs/new_out.gif'");

相关文章:

  • 2022-12-23
  • 2022-02-06
  • 2022-03-02
  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
猜你喜欢
  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
  • 2021-08-27
  • 2021-08-03
  • 2021-07-29
相关资源
相似解决方案