Closed neocotic closed 11 years ago
I think I'll start off with the simplest approach to this;
properties = ele.style.match /(display|visibility)\s*:\s*[a-z]+/gi
visible = yes
if properties?
for property in properties
visible = not /(none|hidden)\s*$/i.test property
This should, at least for now, detect obvious hidden elements.
This works as expected and I'll be sure to unit test it as part of #3.
You, sir, are a BOSS.. A
sqrt(4096)
SSdkIGxpa2UgdG8gY2hhdCB3aXRoIHlvdS4gQ291bGQgeW91IGRyb3AgbWUgYSBtYWls
aWFtQGdteC5pdA==
Although detached or generated elements cannot have their styles computed and therefor visibility determined, the
style.display
property should at least be checked.Also, it's probably worth while checking the
visibility
property.