English 中文(简体)
Error on YUI Anim sample
原标题:
  • 时间:2009-11-16 05:16:30
  •  标签:
  • yui

I m getting an error when trying to emulate an YUI Anim sample:

<script src="http://yui.yahooapis.com/3.0.0/build/yui/yui-min.js"></script>
<script>
   YUI().use( anim-base , function(Y){
      var anim =  new Y.Anim({
         node:  .notice ,
         to: {height: 300},
         easing: Y.Easing.backIn
      });

      onClick = function(e){
         e.preventDefault();
         anim.run();
      };

      Y.get( .notice ).on( click , onClick);
   });
</script>

The error is:

Y.Easing is undefined easing: Y.Easing.backIn

I was under the impression that YUI loader would retrieve the needed files.

最佳回答

I got my answer from the YUI Library forum which I will quote:

YUI will load listed modules a their requirements automatically, however, it will not do any kind of full-fledged feature detection to discover if something else have been used.

You need to change the module list in your use statement from anim-base to anim (or add anim-easing). Then your example will work. -Stefan

问题回答

Adding anim-easing, in this case, seems like the right answer -- use() just the submodules you need. Stefan is correct, though: You need to list all the submodules that you re depending on directly in your implementation.





相关问题
YUI "Get" utility to parse JSON response?

The documentation page for the YUI "Get" utility says: Get Utility is ideal for loading your own scripts or CSS progressively (lazy-loading) or for retrieving cross-domain JSON data from ...

(YUI uploader) listeners not fiering events

I m trying to use YUI uploader, but I m not able to open the file dialog window when I click the browse button. I m following (more or less) the example on Yahoos demo. Here is my HTML code: <div ...

Make table rows sortable with YUI

Currently I have a table similar to below: <table id="tbl"> <thead> <tr><th>Example Title</th><th>Title2</th></tr> </thead> &...

Yahoo UI the popup implementation with YAHOO.widget.Dialog

I used the Yahoo.widget.dialog to implement a popup window. Currently, it popups only on the page which is belongs. If I am working on the other (tab browser) pages. The popup window will be not seen....

Error on YUI Anim sample

I m getting an error when trying to emulate an YUI Anim sample: <script src="http://yui.yahooapis.com/3.0.0/build/yui/yui-min.js"></script> <script> YUI().use( anim-base , ...

YUI onDragDrop multiple listeners

I was wondering if anyone was aware of an example that shows multiple listeners to the YUI DDProxy, DD, or DDTarget onDragDrop event. Currently I have a hacked up example going. I m using the http://...

热门标签