How to use YUI2 in YUI3 locally
程序员文章站
2022-04-06 08:25:25
...
1.download YUI3.1.1 and YUI2in3(http://github.com/yui/2in3)
2.include the JS below before the YUI() function
3.Pass the name of the module as argument to the use function,eg:
2.include the JS below before the YUI() function
YUI_config = {
groups: {
yui2: {
base: '/2in3/',//the path holding the modules
patterns: {
'yui2-': {
configFn: function(me){
if (/-skin|reset|fonts|grids|base/.test(me.name)) {
me.type = 'css';
me.path = me.path.replace(/\.js/, '.css');
me.path = me.path.replace(/\/yui2-skin/, '/assets/skins/sam/yui2-skin');
}
}
}
}
}
}
}
3.Pass the name of the module as argument to the use function,eg:
YUI().use('yui2-charts', function(Y){//load yui2-charts module
var.YAHOO = Y.YUI2;//you can get YAHOO Instance from the YUI instance
var mychart = new YAHOO.widget.LineChart(...);
});
上一篇: 漫步者声迈X3怎么样?漫步者声迈X3真无线耳机详细评测
下一篇: python实现两张图片的像素融合