1.1.1 • Published 7 years ago

hidden v1.1.1

Weekly downloads
4
License
-
Repository
github
Last release
7 years ago

hidden

Cross browser Element#hidden

Example

hidden(elem) returns whether that element is hidden. hidden(elem, value) sets the hidden property on the element.

This shims older browsers using style.display = "none"

var hidden = require("hidden")

    , a = document.getElementById("a")
    , b = document.getElementById("b")

console.log("a isHidden", hidden(a))
console.log("b isHidden", hidden(b))

setTimeout(function () {
    a.textContent = "now shown"
    b.textContent = "now hidden"

    hidden(a, false)
    hidden(b, true)
}, 2000)

Installation

npm install hidden

Contributors

  • Raynos

MIT Licenced

1.1.1

7 years ago

1.1.0

8 years ago

1.0.0

10 years ago

0.1.0

11 years ago