dojo/dom-style

Manipula estilos css en nodos

  • getComputedStyle(). Devuelve un objeto con las propiedades de un nodo.
require(["dojo/dom-style", "dojo/dom"], function(domStyle, dom){
  var node = dom.byId("myNode");
  var computedStyle = domStyle.getComputedStyle(node);
});

Ejemplo Código completo

  • get(). Devuelve una propiedad en concreto de una clase que posee un nodo.

require(["dojo/dom-style"], function(domStyle){
  var width = domStyle.get("someNode", "width");
});

Ejemplo Código completo

  • set(). Establece propiedades de estilo a una clase.

require(["dojo/dom-style"], function(domStyle){
  domStyle.set("someNode", {
    width: "100px",
    backgroundColor: "blue"
  });
});

Ejemplo Código completo

results matching ""

    No results matching ""