diff --git a/inkweb.js b/inkweb.js index 142f51b..6716511 100755 --- a/inkweb.js +++ b/inkweb.js @@ -91,6 +91,28 @@ InkWeb.setStyle = function (el, att, val) { return val } +InkWeb.hide = function (el) { + this.setStyle(el, "display", "none"); +} + +InkWeb.show = function (el) { + this.setStyle(el, "display", "inline"); +} + +InkWeb.toggle = function (el) { + if(this.isHidden(el)) { + this.show(el); + } else { + this.hide(el); + } +} + +InkWeb.isHidden = function (el) { + var display = this.getStyle(el, "display"); + // If display style is not defined, the element is not hidden + return display && display.match("none"); +} + InkWeb.transmitAtt = function (conf) { conf.att = conf.att.split( /\s+/ ); if ( typeof(conf.from) == "string" )