1

I need to switch my code base from using jQuery (1.7.2) and jQueryUI (1.8.6) components to the equivalent YUI components; and per client constraints, it must be version 3.1.2.

However, I am not finding anything for making elements resizable in version 3.1.2 (The only documentation for 3.1.2 that seems to exist is included in).

The jQuery resize looks like this:

$J = jQuery.noConflict(true);
$J("#myElement").resizable('destroy');

The YUI 2 Resize looks like this:

new YAHOO.util.Resize('myElement');

The YUI 3 Resize looks like this (but does not appear in 3.1.2):

YUI().use('resize', function(Y) { $Y = Y; });
new $Y.Resize({node: '#myElement'});

How do I do this in YUI 3.1.2?

user1270393
  • 61
  • 1
  • 2

1 Answers1

0

There are two problems.

First, the resize module became available starting in YUI 3.3.0.

Second, even if resize were available, the code above will not actually work. You need to call your YUI methods inside the use() function callback, like this:

YUI().use('resize', function (Y) {
    new Y.Resize({ node: '#myElement' });
});

See the documentation for Resize for working examples, and be sure to read up on the use() method and the YUI global object before proceeding further.

Evan
  • 680
  • 3
  • 5