From 885fea1f3d458ee884be0b20af03f2fbe362cc8b Mon Sep 17 00:00:00 2001 From: jzaefferer Date: Fri, 26 Mar 2010 20:13:50 -0400 Subject: [PATCH] Drilldown menu: First attempt at drilldown animations --- tests/visual/menu/drilldown.html | 30 +++++++++++++++++++++++++++--- 1 file changed, 27 insertions(+), 3 deletions(-) diff --git a/tests/visual/menu/drilldown.html b/tests/visual/menu/drilldown.html index 0c18c3679..1539045f0 100644 --- a/tests/visual/menu/drilldown.html +++ b/tests/visual/menu/drilldown.html @@ -51,11 +51,23 @@ _open: function(submenu) { this.active = submenu.show().css({ top: 0, - left: 0 + left: 0, + opacity: 0 + }).position({ + my: "left top", + at: "right top", + of: this.widget() }).position({ my: "left top", at: "left top", - of: this.widget() + of: this.widget(), + using: function(to) { + $(this).animate({ + left: to.left, + top: to.top, + opacity: 1 + }); + } }); this.back.show(); }, @@ -64,8 +76,20 @@ if (this.active.parent()[0] == this.element[0]) { return; } - this.active.hide(); + this.active.position({ + my: "left top", + at: "right top", + of: this.widget(), + using: function(to) { + $(this).animate({ + left: to.left, + top: to.top, + opacity: 0 + }); + } + }); this.active = this.active.parent().parent().show(); + this.activeItem = this.active.data("menu").active; if (!this.active.parent().parent().is(":ui-menu")) { this.back.hide(); }