Opened 10 years ago

Closed 10 years ago

Last modified 10 years ago

#8813 closed defect (invalid)

Either dojo.fadeOut fails to work on a node or documentation is wrong

Reported by: roman2 Owned by: anonymous
Priority: high Milestone: tbd
Component: General Version: 1.3.0b2
Keywords: Cc:
Blocked By: Blocking:

Description

... or I understood the documentation incorrectly.

According to http://api.dojotoolkit.org/jsdoc/dojo/HEAD/dojo.fadeOut, fadeOut is supposed to work on a node. So, I expected the following to work:

dojo.byId("testNode").fadeOut({ delay: 1000 }).play();

However, I get an error message saying that fadeOut is not a function.

The following works:

dojo.query("#testNode").fadeOut({ delay: 1000 }).play();

Since dojo.query() returns NodeList?, and dojo.byId returns a DomNode?, it seems to me that either fadeOut needs to be made to work with a node or the documentation needs to state that fadeOut works only on a NodeList?. I guess the same applies to fadeIn too.

Change History (3)

comment:1 Changed 10 years ago by bill

Resolution: invalid
Status: newclosed

You've misunderstood the documentation...

dojo.fadeOut() "works on a node" meaning that you pass a node as part of the argument to dojo.fadeOut. Not sure where the examples for dojo.fadeOut() are in the book but you can follow the examples for dojo.fx.wipeIn which is basically the same, see http://docs.dojocampus.org/dojo/fx/wipeIn-examples

comment:2 Changed 10 years ago by roman2

Thanks, Bill. Now I understand it better. I used "dojo.require("dojo.NodeList?-fx");" following an example on http://sitepen.com/labs/guides/?guide=DojoQuickStart#DomMagic and didn't really understand what I was doing. I guess my expectations got mixed in. I thought it would natural to be able to do dojo.byId("testNode").fadeOut() as it was to do dojo.query("#testNode").fadeOut(). Maybe it would be useful to be able to do this.

comment:3 Changed 10 years ago by bill

Yup, that would be convenient, but the problem is that when a toolkit starts adding methods to DOMNodes the user runs into problems on pages that load two toolkits (like dojo and prototype). So dojo has a philosophy not to do that.

Note: See TracTickets for help on using tickets.