Domanda

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?

È stato utile?

Soluzione

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.

Altri suggerimenti

I would say there is a bug somewhere.

If you look at the code there : http://yuilibrary.com/yui/docs/api/files/transition_js_transition-native.js.html#l547.

You see that, when the 'transition' module is loaded, you can call the hide method with a transition name, a config and callback. Exactly the same as calling transition method.

But:

1) you then need to set opacity to 0 in the config object, if you want to hide. This is weird, as the method is called hide.

2) The modified (by transition module) method looks like it is not available on NodeList. On your example your are then still calling the hide method defined in: http://yuilibrary.com/yui/docs/api/files/node_js_node-view.js.html#l191

Autorizzato sotto: CC-BY-SA insieme a attribuzione
Non affiliato a StackOverflow
scroll top