Search code examples
yuiyui3

How to make YUI 3 fade duration work?


An example is on:

http://jsfiddle.net/a9j28/18/

In the YUI 3 Cookbook by O'Reilly, it is said that

    Y.all('.ad').hide({
        duration: 6.0
    });

should fade the element in 6.0 seconds, but it is still fading quite fast, more like the default behavior. Why / how to make it actually work?


Solution

  • I am the author of the YUI 3 Cookbook. I possibly made a mistake when designing and testing that example -- if so, I apologize for that!

    To get the example to fade slower, you can call transition() instead of hide() -- setting the opacity to 0 as well, of course.