Monday, December 29, 2008

[jQuery] define and invoke class inside $(document).ready

Is that a correct way to create class utilizing jQuery?

var myClass = null;

$(document).ready(function(){
function MyClass(){
this.imagesHolder = null;
}

MyClass.prototype.init = function (){
this.imagesHolder = jQuery("#imgs");
}

myClass = new MyClass();
});

No comments: