How to use YUI2 in YUI3 locally

1.download YUI3.1.1 and YUI2in3(http://github.com/yui/2in3)
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(...);
});

你可能感兴趣的:(css,Yahoo,yui)