daniel-nemeth/jqclass

Provides a class functionality for jQuery

Installs: 18

Dependents: 1

Suggesters: 0

Security: 0

Type:contao-component

1.0.0 2018-12-29 14:00 UTC

This package is not auto-updated.

Last update: 2024-03-17 21:28:22 UTC


README

Provides an ordinary class functionality for jQuery. This is an contao-component.

Class declaration

var myClass = new jqClass({
    options: {
        content: null,
        container: null
    },

    initialize: function(options) {
        this.setOptions(options);
    },
 
    speak: function() {
        this.options.container.html(
            '<b>' + this.options.content + '</b>'
        );
    }
});

Usage

var mytest = new myClass({
    content: 'foo',
    container: $('#bar')
});

mytest.speak();