[CLOSED] Animate Menu

  1. #1

    [CLOSED] Animate Menu

    Is there a simple way to animate a menu on show event?
    I would like it to kind of slide down from the toolbar.


    /PatrikG
    Last edited by Daniil; Apr 12, 2012 at 8:09 AM. Reason: [CLOSED]
  2. #2
    Hi,

    Maybe something like this.

    Example
    <%@ Page Language="C#" %>
    
    <%@ Register Assembly="Ext.Net" Namespace="Ext.Net" TagPrefix="ext" %>
    
    <!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>Ext.NET v2 Example</title>
    
        <script type="text/javascript">
            var onClick = function (btn, menu) {
                var menu = btn.bin[0];
                    x = btn.el.getLeft(),
                    y = btn.el.getBottom();
    
                menu.showAt(x, y, {
                    duration : 2000,
                    easing : "easeIn",
                    from : {
                        height : "0px"
                    },
                    to : {
                        height : menu.items.getCount() * 27 + 6 + "px"
                    }
                });
            };
        </script>
    </head>
    <body>
        <form runat="server">
            <ext:ResourceManager runat="server" />
    
            <ext:Toolbar runat="server">
                <Items>
                    <ext:Button runat="server" Text="Menu" Icon="ArrowDown">
                        <Bin>
                            <ext:Menu runat="server">
                                <Items>
                                    <ext:MenuItem runat="server" Text="Item 1" />
                                    <ext:MenuItem runat="server" Text="Item 2" />
                                </Items>
                            </ext:Menu>
                        </Bin>
                        <Listeners>
                            <Click Fn="onClick" />
                        </Listeners>
                    </ext:Button>
                </Items>
            </ext:Toolbar>
        </form>
    </body>
    </html>
  3. #3

    Perfect!

    Thank you very much.

    /Patrik

Similar Threads

  1. Replies: 2
    Last Post: Apr 02, 2012, 7:48 AM
  2. [CLOSED] combo in compositefield in menu closing menu on selection
    By smmille1 in forum 1.x Legacy Premium Help
    Replies: 2
    Last Post: Oct 07, 2011, 4:06 PM
  3. [CLOSED] Splitbutton with Menu - Make the menu expand upwards?
    By rbarr in forum 1.x Legacy Premium Help
    Replies: 2
    Last Post: Aug 02, 2011, 1:18 PM
  4. [CLOSED] Is there any way to animate window
    By webppl in forum 1.x Legacy Premium Help
    Replies: 1
    Last Post: Dec 10, 2010, 6:06 AM
  5. [CLOSED] Custom Animate Target
    By amitpareek in forum 1.x Legacy Premium Help
    Replies: 1
    Last Post: Dec 30, 2009, 7:53 AM

Posting Permissions