dojo/dom-style¶
Project owner: | Eugene Lazutkin |
---|---|
since: | V1.7 |
Contents
This module defines the core dojo DOM style API. The convention for the return variable for this module is domStyle
.
Features¶
AMD Features¶
-
Returns a “computed style” object.
domStyle.toPixelValue
Converts style value to pixels on IE or return a numeric value.
-
Accesses styles on a node.
-
Sets styles on a node.
Legacy features are set in dojo/_base/html.
Examples¶
Here is an example of how to set the style of display: none;
on a DOM node:
require(["dojo/dom", "dojo/dom-style"], function(dom, domStyle){
var myNode = dom.byId("myNode");
domStyle.set(myNode, "display", "none");
});
See also¶
- dojo/dom - Core DOM API
- dojo/dom-attr - DOM Attribute API
- dojo/dom-class - Dojo DOM Class API
- dojo/dom-prop - DOM Property API
- dojo/_base/html - Legacy API aliases