2010-03-22 94 views

回答

2

您不一定需要擴展特定的元素類型。如果您提供了toElement方法,您可以定義在這種情況下采用採用 ed:

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