Created framework

objects / libraries


objects are based on the structure:

function $name() {

var ...;

this.methodA = function() {
};

this.methodB = function() {
};

this.init = function() {
};

this.init()

}
Possibly integrated libraries from the Internet must be independently working, linked to the DOM element and configurable via some settings.

I write my own libraries in such a way that the behavior of objects can be controlled only by setting the object parameters and the behavior can be extended by redeclaring methods that are declared as empty in the library. The object is always wrapped as HTML by some single main element with an ID that is some default and can be changed. It must also have a destructor and possibly method for reset of object. It must account for placement in layers (z-index). It must allow to modify CSS, possibly via parameters to change the CSS classes to the currently needed one.

In elements I use most often the ID and if it is useful the ID is formed from the ID of the root element of  object, plus additional information to facilitate the location in more complex structures so that it is not necessary to search for the object => simpler selectors, or easy derivation of the ID of the searched element.

For objects designed this way, I can easily change the behavior for a specific case or I can dynamically change the behavior on the fly just by changing methods or parameters.

The goal is to make the code as efficient as possible.