Opened 14 years ago
Closed 14 years ago
#4223 closed bug (wontfix)
:visible,:hidden doesn't take visibility into account
Reported by: | Akzhan | Owned by: | john |
---|---|---|---|
Priority: | major | Milestone: | 1.4 |
Component: | selector | Version: | 1.3.2 |
Keywords: | :visible, :hidden, visibility | Cc: | |
Blocked by: | Blocking: |
Description
:visible and :hidden selectors doesn't take CSS visibility attribute into account.
Reported by habr-user Octane.
Sample code:
<html> <head> <script src="jquery-1.3.2.js"></script> <script> $(function() {
$('#test').css('visibility', 'hidden'); var visible = $('#test').is(':visible'); → true var hidden = $('#test').is(':hidden'); → false alert([visible, hidden]);
}); </script> </head> <body>
<div id="test">test</div>
</body> </html>
Change History (4)
comment:1 Changed 14 years ago by
comment:2 Changed 14 years ago by
It's mostly about what makes sense and how it's documented.
An opacity:0
has the same net effect as visibility:hidden
, should that return false as well? What about an element positioned left: -1000px, top:-1000px
which is out of the view port and thus "invisible"?
comment:4 Changed 14 years ago by
Resolution: | → wontfix |
---|---|
Status: | new → closed |
Additional remark:
visibility CSS style attribute doesn't affect offsetWidth/offsetHeight properties.