]> source.dussan.org Git - jquery-ui.git/commitdiff
Drilldown menu: First attempt at drilldown animations
authorjzaefferer <joern.zaefferer@gmail.com>
Sat, 27 Mar 2010 00:13:50 +0000 (20:13 -0400)
committerjzaefferer <joern.zaefferer@gmail.com>
Sat, 27 Mar 2010 00:13:50 +0000 (20:13 -0400)
tests/visual/menu/drilldown.html

index 0c18c3679bd58aa381ffd54842d2db9592ae6607..1539045f05045bc613fc909c449d5b0e980b7c72 100644 (file)
                        _open: function(submenu) {
                                this.active = submenu.show().css({
                                        top: 0,
-                                       left: 0
+                                       left: 0,
+                                       opacity: 0
                                }).position({
                                        my: "left top",
-                                       at: "left top",
+                                       at: "right top",
                                        of: this.widget()
+                               }).position({
+                                       my: "left top",
+                                       at: "left top",
+                                       of: this.widget(),
+                                       using: function(to) {
+                                               $(this).animate({
+                                                       left: to.left,
+                                                       top: to.top,
+                                                       opacity: 1
+                                               });
+                                       }
                                });
                                this.back.show();
                        },
                                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();
                                }