1.0.8 • Published 10 years ago

techknow-dominator v1.0.8

Weekly downloads
2
License
ISC
Repository
github
Last release
10 years ago

This file contains both the Helpers and Dominator classes within the Techknow namespace.

v 1.0.7 updates: fixed a bug that prevented multiple instances from being displayed on the page

Basic Usage:

var domElement = new Techknow.Dominator({
	insert: {
		into: 'body',
		//before: '.content',
		//after: '.header',
		//atTheStartOf: 'body',
		//atTheEndOf: 'body',
	},
	structure: [{
		tag: 'article',
		attr: {
			class: 'myNewArticleElementClassName otherClassName'
		},
		listeners: {
			event: 'click', // jquery event
			data: this, // item to be passed into callback as e.data
			target: '.childElementForDelegation', // sets the scope of 'this' in the callback
			action: function(e) {
				console.log('Running most awesome code here');
			},
		},
		children: [{
			tag: 'div',
			children: [{
				tag: 'span',
				text: 'My Awesome Article Div Span Text!',
				attr: {
					'data-span-prop': 'some data on the data-span-prop property',
				}
			}],
		}]
	}],
});
domElement.render(); //inserts element into page at insertion point
// domElement.buildNode(); //returns a javascript dom node representation without inserting into the dom
1.0.8

10 years ago

1.0.7

10 years ago

1.0.6

10 years ago

1.0.5

10 years ago

1.0.4

10 years ago

1.0.3

10 years ago

1.0.2

10 years ago

1.0.1

10 years ago

1.0.0

10 years ago