1.类模板 var yourClass = new Class({ //implements Implements: [Options], //options options: { yourOption: '' }, //initialization initialize: function(options) { //set options this.setOptions(options); }, //a method that does whatever you want yourMethod: function() { } }); 2.使用方法示例 //once the DOM is ready window.addEvent('domready', function() { var yourInstance = new yourClass({ yourOption: 'yourValue' }); }