Opened 16 years ago

Closed 15 years ago

#740 closed defect (wontfix)

[lfx] Need a generic toggle function

Reported by: [email protected] Owned by: Bryan Forbes
Priority: high Milestone: 0.9
Component: General Version: 0.2
Keywords: lfx toggle Cc:
Blocked By: Blocking:


A very common use-case for the lfx functions is to toggle a certain element with a certain effect (fade, wipe, etc.). The current toggle code does not support this, rather, it just provides an additional wrapper on top of the lfx functions.

So that means, while I can do or hide(), I can't just do dojo.lfx.toggle.wipe(), which is the common use case I was talking about above.

The function below should do the trick providing a simple toggle function for the types supported in lfx/toggle.js (thanks to ttrenka and dmachi for their help!):

function dojo.lfx.toggle(node, toggleType, duration, easing, callback) {
     var t = toggleType || "plain";
     var action = ( == "none") ? "show" : "hide";
     dojo.lfx.toggle[t][action](node, duration, easing, callback);

Change History (3)

comment:1 Changed 16 years ago by Bryan Forbes


comment:2 Changed 15 years ago by dylan

Milestone: 0.40.5

comment:3 Changed 15 years ago by dante

Resolution: wontfix
Status: newclosed

enhancement for 0.4

Note: See TracTickets for help on using tickets.