Animation Scale on Repeat

Last post 09-01-2008 7:50 AM by Thomas Sun – MSFT. 1 replies.

Sort Posts:

  • Animation Scale on Repeat

    08-27-2008, 3:59 AM
    • Member
      74 point Member
    • kmj2384
    • Member since 03-31-2008, 11:59 PM
    • Posts 211

    How do I get the scale animation to repeat as long as the person is surfing the page?  The code I have so far makes it big then makes it small, I'd like this on repeat.  So far this is the code I have:

    <ajaxToolkit:AnimationExtender id="AnimationExtender1"

    runat="server" TargetControlID="MyPanel">

    <Animations>

    <OnLoad>

    <sequence>

    <Scale ScaleFactor="1.5" Unit="px" Center="true"

    ScaleFont="true" FontUnit="pt" Duration="1.5" Fps="30" />

    <parallel>

    <Scale ScaleFactor=".5" Unit="px" Center="true"

    ScaleFont="true" FontUnit="pt" Duration="1.5" Fps="30" />

    </parallel>

    </sequence>

    </OnLoad>

    </Animations>

    </ajaxToolkit:AnimationExtender>

  • Re: Animation Scale on Repeat

    09-01-2008, 7:50 AM
    Answer

    Hi,

    We can simulate click event to trigger the AnimationExtender using setTimeout.

    For instance:

    <%@ Page Language="C#" %>
    
    <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
    <html xmlns="http://www.w3.org/1999/xhtml">
    <head runat="server">
        <title>Untitled Page</title>
    </head>
    
    <script type="text/javascript">
    function pageLoad()
    {
        $get('MyPanel').click();
        var t=setTimeout("ShowAnimation()",5000);
    
    }
    
    function ShowAnimation()
    {
        
        $get('MyPanel').click();
        var t=setTimeout("ShowAnimation()",5000);
    } 
    </script>
    
    <body>
        <form id="form1" runat="server">
            <div>
                <asp:scriptmanager ID="ScriptManager1" runat="server">
                </asp:scriptmanager>
                <ajaxToolkit:AnimationExtender ID="AnimationExtender1" runat="server" TargetControlID="MyPanel">
                    <Animations>
    
                    <OnClick>
    
                    <sequence>
    
                    <Scale ScaleFactor="1.5" Unit="px" Center="true"
    
                    ScaleFont="true" FontUnit="pt" Duration="1.5" Fps="30"  />
    
                    <parallel>
    
                    <Scale ScaleFactor=".5" Unit="px" Center="true"
    
                    ScaleFont="true" FontUnit="pt" Duration="1.5" Fps="30" />
    
                    </parallel>
    
                    </sequence>
    
                    </OnClick>
    
                    </Animations>
                </ajaxToolkit:AnimationExtender>
                <asp:panel ID="MyPanel" runat="server" Height="50px" Style="position: static" Width="125px">
                    teste</asp:panel>
            </div>
        </form>
    </body>
    </html>

     

    I look forward to hearing from you.

    Thomas Sun
    Microsoft Online Community Support

    Please remember to click “Mark as Answer” on the post that helps you, and to click “Unmark as Answer” if a marked post does not actually answer your question.
Page 1 of 1 (2 items)