PDA

View Full Version : [CLOSED] Animate Menu



PatrikG
Apr 11, 2012, 12:27 PM
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

Daniil
Apr 11, 2012, 5:39 PM
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>

PatrikG
Apr 12, 2012, 7:58 AM
Thank you very much.

/Patrik