Click here to Skip to main content
15,893,487 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
Hi all,

I would like to add a close button to the panel which I am using as target for my Ajax animation Extender, so that when client clicks the button the panel gets closed.

I have used this code
JavaScript
<asp:ToolkitScriptManager ID="ToolkitScriptManager1" runat="server">
 </asp:ToolkitScriptManager>

 <asp:Button ID="btn_Animate" runat="server" Text="Animate" OnClientClick="return false;" />
<br />


<asp:Panel ID="panel_Animated2" runat="server" CssClass="Animation2">
              Hi this is a new animation
</asp:Panel>
      <br />
      <asp:AnimationExtender ID="AnimationExtender2" runat="server" TargetControlID="btn_Animate">

      <Animations>
          <OnClick>
              <Sequence AnimationTarget="panel_Animated2">
                  <EnableAction AnimationTarget="btn_Animate" Enabled="false" />
                      <StyleAction Attribute="display" Value="Block" />
                          <Parallel >
                              <FadeIn Duration="1" Fps="20"  />
                              <Scale Duration="1" Fps="20" ScaleFactor="30.0" Center="true" />
                              <Color PropertyKey="color" StartValue="#FFFFFF" EndValue="#660033" />
                          </Parallel>
                      </Sequence>
           </OnClick>
      </Animations>

     </asp:AnimationExtender>
Posted
Updated 19-Nov-11 23:45pm
v2
Comments
André Kraak 20-Nov-11 5:45am    
Edited question:
Added pre tags

1 solution

By closed if you mean collapsed then you can use the accordian control. Othewise if you to make it not visible a few lines of JavaScript will do.

$("#panelDiv").hide();
 
Share this answer
 

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900