对Ajax一直只是处于一种了解的状态,有时也不是很想学习这门技术,不想学习的原因倒不是自己懒,只是想多接触些其它方面的知识,但经过一些事情后,感觉自己学习一下还是有必要的,所以就在这里稍微做些记录吧(网上也都有相关的代码),以后说不定会用到。
下面的代码是在页面一加载后,将页面中的重要的信息进行颜色的变化,以起到强调的作用,当变化终止后,再将按钮置为可用。
<ajaxToolkit:AnimationExtender ID="AnimationExtender1" runat="server" TargetControlID="Button1" >
<Animations>
<OnLoad>
<Sequence>
<EnableAction Enabled="false" />
<Color AnimationTarget="MyContent"
Duration="1"
StartValue="#FF0000"
EndValue="#666666"
Property="style"
PropertyKey="backgroundColor" />
<Color AnimationTarget="MyContent"
Duration="1"
StartValue="#FF0000"
EndValue="#666666"
Property="style"
PropertyKey="backgroundColor" />
<EnableAction Enabled="true" />
</Sequence>
</OnLoad>
</Animations>
</ajaxToolkit:AnimationExtender>
<asp:Button ID="Button1" runat="server" Text="Button" />
<div id="MyContent">此处信息颜色变化</div>