 |
 User: Login | Is a collection of industrial-grade JavaScript utilities and widgets that enable you to efficiently get the most out of today’s powerful web applications. News and Articles about Designing and Developing with Yahoo! Libraries. |
| Address URL | http://www.yuiblog.com/blog Registered: 26-Apr-2008 |
| Ads: |
|
Send to email | Coming in YUI 3.2.0: SimpleYUI in Development | By Eric Miraglia and Adam Moore el 03-Sep-2010 | The feature described in this article is available as of YUI 3.2.0pr2, and it will be a part of the upcoming 3.2.0 release. You can start playing with it today by following the code in this article.
SimpleYUI is a new way of loading and instantiating YUI 3. The SimpleYUI file contains a rollup of basic Ajax library functionality: DOM tasks, event abstraction, UI effects, and Ajax. Unlike other ways of loading YUI, SimpleYUI creates a YUI instance immediately upon loading and binds all included components to a global Y variable. Using SimpleYUI is easy:
<script type="text/javascript"
src="http://yui.yahooapis.com/3.2.0pr2/build/simpleyui/simpleyui-min.js"></script>
<script>
//Y is ready to use; no instantiation necessary:
Y.one("#foo").addClass("highlight");
</script>
This isn’t a “lite” or de-contented version of YUI ? you still have access to all of the power and features of the entire library when you start with the SimpleYUI file. However, SimpleYUI does provide a nice convenience by rolling up some common functionality and creating a global instance (Y) that’s ready to use immediately.
Work with the DOM
SimpleYUI gives you all of the standard DOM interactions in the YUI 3 API:
//get an element reference, add a click handler
Y.one('#demo').on('click', function(e) {/*handle click*/});
//add content to an element
Y.one('#demo').append('Additional content added to #demo.');
//listen for any click on any <li> that descends from #demo:
Y.one('#demo').delegate('click', function(e) {/*handle click*/}, 'li');
//move #demo to the location of any click on the document
Y.one('document').on('click', function(e) {
Y.one('#demo').setXY([e.pageX, e.pageY]);
}
);
Create UI Effects
All of the UI effects that are part of the (new-for-3.2.0) YUI Transition module are available in SimpleYUI:
//fade #demo, then remove it from the DOM:
Y.one('#demo').transition({
easing: 'ease-out',
duration: 2, // seconds
opacity: 0
}, function() {
this.remove();
});
Ajax
SimpleYUI provides the IO module’s basic Ajax functionality:
// Make an HTTP request to 'get.php':
Y.io('get.php', {
on: {
complete: function (id, response) {
var data = response.responseText; // Response data.
// ... handle the response ...
}
}
});
The rest of YUI is just a use() away
You aren’t limited to what comes bundled with SimpleYUI. You can bring in any other YUI 3 component, YUI 3 Gallery module, or YUI 2 component with a simple use() statement at any time.
//Use drag and drop, which is not included in the SimpleYUI rollup:
Y.use('dd-drag', function(Y) {
var dd = new Y.DD.Drag({
node: '#foo'
});
});
YUI 3 is good about loading anything you need whenever you need it; just master the use() statement and you’re always just one line of code away from anything in the library that you need.
Use SimpleYUI when…
- …you want to get started fast and learn the ropes of YUI;
- …you want to have basic Ajax library functionality available at any time in the life of the page without creating a new YUI instance.
Don’t use SimpleYUI when…
- …performance matters more than convenience;
- …you want to sandbox portions of your implementation into separate instances;
- …you want to be deliberate about when different components load and what the precise module/submodule makeup is on the page.
Read 20 times

|
|
 |
 |
 | Yahoo User Interface Blog | Blogger | Is a collection of industrial-grade JavaScript utilities and widgets that enable you to efficiently get the most out of today’s powerful web applications. Yahoo! User Interface Blog News and Articles about Designing and Developing wiht Yahoo! Libraries. |
| Coming in YUI 3.2.0: SimpleYUI | | The feature described in this article is available as of YUI 3.2.0pr2, and it will be a part of the upcoming 3.2.0 release. You can start playing with it today by following the code in this article.
SimpleYUI is a new way of loading and instantiating YUI 3. The SimpleYUI file contains a rollup [...] [..] Read complete article |  | Published 03-Sep-2010 by Eric Miraglia and Adam Moore in Development Read 20 times. More hits in  |
|
 | Yahoo User Interface Blog | Blogger | Is a collection of industrial-grade JavaScript utilities and widgets that enable you to efficiently get the most out of today’s powerful web applications. Yahoo! User Interface Blog News and Articles about Designing and Developing wiht Yahoo! Libraries. |
 | Kotaku`s The Gamers Guide | Blogger | XBOX 360 Gamers Weblog
Gossip, news and leaks for obsessive gamers Kotaku As if you don't waste enough of your time in a gamer's haze, here's Kotaku: a gamer's guide that goes beyond the press release. Gossip, cheats, criticism, design, nostalgia, pred |
 | Joystiq | Blogger | Covers video game news from an independent, unbiased perspective Joystiq Joystiq |
 | Kotaku`s The Gamers Guide | Blogger | XBOX 360 Gamers Weblog
Gossip, news and leaks for obsessive gamers Kotaku As if you don't waste enough of your time in a gamer's haze, here's Kotaku: a gamer's guide that goes beyond the press release. Gossip, cheats, criticism, design, nostalgia, pred |
| Castle Crashers Patch Still Coming, Still Coming [Xbox Live Arcade] | | Remember back in September when The Behemoth calmed our fears about Castle Crashers' shaky online multiplayer, noting that "we?re on our way to getting this title update out"? Yeah, whatever happened to that, Behemoth? Three months later, with patience weari [..] Read complete article |  | Published 01-Dec-2008 by Michael McWhertor in Xbox Live Arcade Castle Crashers patch watch The Behemoth Xbla Xbox 360 Read 22 times. More hits in ![Images about Castle Crashers Patch Still Coming, Still Coming [Xbox Live Arcade]](./images/photo.gif) |
|
 | Joystiq | Blogger | Covers video game news from an independent, unbiased perspective Joystiq Joystiq |
 | Joystiq | Blogger | Covers video game news from an independent, unbiased perspective Joystiq Joystiq |
 | Joystiq | Blogger | Covers video game news from an independent, unbiased perspective Joystiq Joystiq |
 | Joystiq | Blogger | Covers video game news from an independent, unbiased perspective Joystiq Joystiq |
 | Kotaku`s The Gamers Guide | Blogger | XBOX 360 Gamers Weblog
Gossip, news and leaks for obsessive gamers Kotaku As if you don't waste enough of your time in a gamer's haze, here's Kotaku: a gamer's guide that goes beyond the press release. Gossip, cheats, criticism, design, nostalgia, pred |
 | Kotaku`s The Gamers Guide | Blogger | XBOX 360 Gamers Weblog
Gossip, news and leaks for obsessive gamers Kotaku As if you don't waste enough of your time in a gamer's haze, here's Kotaku: a gamer's guide that goes beyond the press release. Gossip, cheats, criticism, design, nostalgia, pred |
| Watchmen: Justice Is Coming Is Coming To iPhones [Game Announce] | Watchmen: The End Is Nigh isn't the only game shipping alongside the release of the big-budget, over-advertised adaptation of the graphic novel. There's an iPhone game coming too, the online multiplayer Watchmen: Justice Is Coming. Described as a "multiplayer onli [..] Read complete article |  | Published 02-Mar-2009 by Michael McWhertor in Game Announce iPhone watchmen Watchmen: justice is coming Read 19 times. More hits in ![Images about Watchmen: Justice Is Coming Is Coming To iPhones [Game Announce]](./images/photo.gif) |
|
 | Kotaku`s The Gamers Guide | Blogger | XBOX 360 Gamers Weblog
Gossip, news and leaks for obsessive gamers Kotaku As if you don't waste enough of your time in a gamer's haze, here's Kotaku: a gamer's guide that goes beyond the press release. Gossip, cheats, criticism, design, nostalgia, pred |
|
Warning We are not responsible of information posted from external feeds. Use this website at your own risk.
Notice: We will not be liable for any direct or indirect loss or damage arising under this disclaimer or in connection with our website, whether arising in tort, contract, or otherwise.
|
|
| |