How to define a class that I can install later?
I wrote myself a rotator class using jquery, which looks like this:
var Rotator = { Loop: null, init: function(identifierName) { ........ } }
If I want to have one rotator on my page, thatβs good. I just call Rotator.init() and am ready. However, when I want to have 3 rotators, I have to define 3 times all the class code, changing its name.
It would be easier if I could just do
Instance1 = new rotator; Instance2 = new rotator; Instance3 = new rotator;
source share