tmt.css

tmt.css is a JavaScript library that offers some utility methods for dealing with CSS. It's nothing too fancy, but it's simple and lightweight.

In order to use this library you need tmt_core.js and tmt_css.js

Samples

API

tmt.css.displayBlock(field1, [field2]) Set display to "block" on a list of nodes. Accepts either ids (strings) or DOM node references
tmt.css.displayNone(field1, [field2]) Set display to "none" on a list of nodes. Accepts either ids (strings) or DOM node references
tmt.css.toggleDisplay(field1, [field2]) Toggle display of a given set of nodes. If it's "block" it set it to "none" and viceversa. Accepts either ids (strings) or DOM node references
tmt.css.show(field1, [field2]) Set visibility to "visible" on a list of nodes. Accepts either ids (strings) or DOM node references
tmt.css.hide(field1, [field2]) Set visibility to "hidden" on a list of nodes. Accepts either ids (strings) or DOM node references
tmt.css.toggle(field1, [field2]) Toggle visibility of a given set of nodes. If it's "visible" it set it to "hidden" and viceversa. Accepts either ids (strings) or DOM node references
tmt.css.getNodesByClass(className, startNode) Return an array of nodes that contain the given class. If no starting node is passed, assume the document is the starting point
tmt.css.getStyleProperty(element, property) Get the value of a specified CSS property out of a given node. Accepts either an id (string) or a DOM node reference
tmt.css.setStyleProperty(element, propName, propValue) Set the value of a CSS property on a given node. Accepts either an id (string) or a DOM node reference