2.0.1 • Published 8 years ago

dom-conform v2.0.1

Weekly downloads
1
License
MIT
Repository
github
Last release
8 years ago

dom-conform

Resolve and find element class names

Concept

//Add "hello" to the element class list.
conform(element, "hello", true);

//Remove "hello" from the element class list.
conform(element, "hello", false);

//Determine whether the element class list contains "hello"
conform(element, "hello");
//Return the first child of element conforming to "world"
conform.find(element, "world");

//Run the callback function on each child of element conforming to "world"
conform.find(element, "world", callback);
//Return the first parent of element conforming to "world"
conform.closest(element, "world");

Examples

var submit = function() {
	//Mark the form as "invalid"
	conform(form, "invalid", true);
}
var layout = function() {
	//Run the specified function on conforming childs
	conform.find(element, "aspect-fill", function(child){
		//Calculate ratio and update child geometric style properties.
	});
}
var menuClickHandler = function(event) {
	//Get the menu item of the clicked target
	var item = conform.closest(event.target, "menu-item");
}
2.0.1

8 years ago

2.0.0

8 years ago

1.1.1

8 years ago

1.1.0

8 years ago

1.0.0

8 years ago