如何使用动画扩展器进行淡入和淡出 [英] How to use animation extender for fade-in and fade-out

查看:75
本文介绍了如何使用动画扩展器进行淡入和淡出的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我想点击按钮淡化和淡出面板。在下面的代码中,单击

面板可帮助面板逐渐消失。如何使用按钮发生这两种情况。



 <   asp:UpdatePanel     ID   =  UpdatePanel133    runat   =  server   >  
< ContentTemplate >
< asp:面板 ID = ss runat = server style = width:544px;高度:333px;背景色:红色;保证金左:230px;顶部:312px >
< / asp:Panel >
< asp:按钮 ID = 动画 runat = server OnClick = ClickToAnimate 文字 = ClickToAnimate BackColor = 绿色 style =
margin-left:12px;高度:24px
/ >
< asp:AnimationExtender id = MyExtender

runat = server TargetControlID = ss >
< 动画 >
< OnClick >
< FadeOut 持续时间 = 。5 Fps = 20 / > <% - FadeIn = .1 Fps = 10 /> - %>
< / OnClick >
< /动画 >
< / asp:AnimationExtender >
< / ContentTemplate >
< / asp:UpdatePanel >





< pre lang =cs> protected void ClickToAnimate( object sender,EventArgs e)
{

}

解决方案

你有没有想过关于将动画扩展器更改为jQuery?

如果是这样,JavaScript会像这样简单:

 


' #<%= UpdatePanel133.ClientID%>')。fadeIn();


' #<%= UpdatePanel133.ClientID%>')。淡出();


I want to fade-in and fade-out a panel on click of a button. In the following code a click on the
panel helps the panel to fade away. How to use the button for both to happen.

<asp:UpdatePanel ID="UpdatePanel133" runat="server" >
    <ContentTemplate>
    <asp:Panel ID="ss" runat="server"  style=" width:544px; height:333px; background-color:Red; margin-left:230px; top:312px">
    </asp:Panel>
<asp:Button ID="Animate" runat="server" OnClick="ClickToAnimate" Text="ClickToAnimate" BackColor="Green" style="
     margin-left:12px; height:24px" />
<asp:AnimationExtender id="MyExtender"

  runat="server" TargetControlID="ss">
  <Animations>
    <OnClick>
      <FadeOut Duration=".5" Fps="20" /><%-- FadeIn =".1" Fps="10"/>--%>
    </OnClick>
  </Animations>
</asp:AnimationExtender>
</ContentTemplate>
    </asp:UpdatePanel>



protected void ClickToAnimate(object sender, EventArgs e)
  {

  }

解决方案

Have you thought about changing your animation extenders to jQuery ?
If so, the JavaScript would be as easy as this :


('#<%=UpdatePanel133.ClientID %>').fadeIn();


('#<%=UpdatePanel133.ClientID %>').fadeOut();


这篇关于如何使用动画扩展器进行淡入和淡出的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆