Skip to content

Commit

Permalink
doc: Merge/update old Elements.Methods.visible docs into source [#88
Browse files Browse the repository at this point in the history
…state:fixed_in_branch]
  • Loading branch information
dandean authored and samleb committed Jan 12, 2010
1 parent 748e48a commit ed5f144
Showing 1 changed file with 30 additions and 1 deletion.
31 changes: 30 additions & 1 deletion src/dom/dom.js
Expand Up @@ -166,10 +166,39 @@ Element.cache = { };
**/
Element.Methods = {
/**
* Element.visible(@element) -> boolean
* Element.visible(@element) -> Boolean
*
* Tells whether `element` is visible (i.e., whether its inline `display`
* CSS property is set to `none`.
*
* ##### Examples
*
* <div id="visible"></div>
* <div id="hidden" style="display: none;"></div>
*
* $('visible').visible();
* // -> true
*
* $('hidden').visible();
* // -> false
*
* ##### Notes
*
* Styles applied via a CSS stylesheet are _not_ taken into consideration.
* Note that this is not a Prototype limitation, it is a CSS limitation.
*
* <style>
* #hidden-by-css {
* display: none;
* }
* </style>
*
* [&#8230;]
*
* <div id="hidden-by-css"></div>
*
* $('hidden-by-css').visible();
* // -> true
**/
visible: function(element) {
return $(element).style.display != 'none';
Expand Down

0 comments on commit ed5f144

Please sign in to comment.