Skip to content

Commit

Permalink
Version 0.0.6
Browse files Browse the repository at this point in the history
  • Loading branch information
santoshrajan committed Jul 6, 2013
1 parent b8c6030 commit b670d66
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 2 deletions.
2 changes: 2 additions & 0 deletions README.md
Expand Up @@ -14,6 +14,8 @@ Same as document.querySelectorAll
`callback` is called with each `Element` of the `NodeList` returned by `querySelectorAll(selector)`.
#### $.map(selector, callback)
`callback` is called with each `Element` of the `NodeList` returned by `querySelectorAll(selector)`. Returns `Array`.
#### $.style(selector, stylename, stylevalue)
Changes the selector(s) style.stylename to stylevalue.
#### $.display(selector, displayValue)
Changes the selector(s) style.display to displayValue. eg. "none", "block" etc
#### $.ready(callback)
Expand Down
7 changes: 5 additions & 2 deletions tinix.js
Expand Up @@ -24,12 +24,15 @@ tinix.map = function(s, f) {
return Array.prototype.map.call(this.all(s), f)
}

tinix.display = function(s, d) {
tinix.style = function(s, n, v) {
this.forEach(s, function(elem) {
elem.style.display = d
elem.style[n] = v
})
}

tinix.display = function(s, v) {
this.style(s, "display", v)
}

tinix.ready = function(f) {
if (document.readyState == "loading") {
Expand Down

0 comments on commit b670d66

Please sign in to comment.