2010-03-22 40 views

回答

2

您不一定需要扩展特定的元素类型。如果您提供了toElement方法,您可以定义在这种情况下采用采用 ed:

var MyDiv = new Class({ 
    initialize: function() { 
     this.realDiv = new Element('div',{id:'foo'}); 
    }, 
    toElement: function() { 
     return this.realDiv; 
    } 
}); 
相关问题