uid | title | author | description | ms.author | ms.date | ms.assetid | msc.legacyurl | msc.type |
---|---|---|---|---|---|---|---|---|
web-forms/overview/ajax-control-toolkit/animation/executing-several-animations-at-the-same-time-cs |
Executing Several Animations at The Same Time (C#) | Microsoft Docs |
wenz |
The Animation control in the ASP.NET AJAX Control Toolkit is not just a control but a whole framework to add animations to a control. It allows to run severa... (C#) |
riande |
06/02/2008 |
219149e1-3ee9-4b79-8fe4-7433f6b7d15b |
/web-forms/overview/ajax-control-toolkit/animation/executing-several-animations-at-the-same-time-cs |
authoredcontent |
The Animation control in the ASP.NET AJAX Control Toolkit is not just a control but a whole framework to add animations to a control. It allows to run several animations in a parallel fashion.
The Animation control in the ASP.NET AJAX Control Toolkit is not just a control but a whole framework to add animations to a control. It allows to run several animations in a parallel fashion.
First of all, include the ScriptManager
in the page; then, the ASP.NET AJAX library is loaded, making it possible to use the Control Toolkit:
[!code-aspxMain]
The animation will be applied to a panel of text which looks like this:
[!code-aspxMain]
In the associated CSS class for the panel, define a nice background color and also set a fixed width for the panel:
[!code-cssMain]
Then, add the AnimationExtender
to the page, providing an ID
, the TargetControlID
attribute and the obligatory runat="server"
:
[!code-aspxMain]
Within the <Animations>
node, use <OnLoad>
to run the animations once the page has been fully loaded. Generally, <OnLoad>
only accepts one animation. The Animation framework allows you to join several animations into one using the <Parallel>
element. All animations within <Parallel>
are executed at the same time.
Here is the a possible markup for the AnimationExtender
control, fading out and resizing the panel at the same time:
[!code-aspxMain]
And indeed: when you run this script, the panel is displayed, then resizes (more than tripling its width and halving its height) and fades out at the same time.
The panel is fading out and resizing (including its content, thanks to the browser's rendering engine) (Click to view full-size image)