getStyle()

Retrieves a property value of an element’s style object.

Syntax

var value = behavior.getStyle(element, propertyName);

Example

var mybehavior = jsb.behavior.extend({
  isTransparent: function(element) {
    return this.getStyle(element, "opacity") == "0";
  }
});

Notes

This method provides a cross-browser, safe way to access style properties. Most of the time you can just directly access the style object. You should use this method to access properties that are not supported across all browser platforms (e.g opacity).

See Also