Bug Tracker

Opened 10 years ago

Closed 10 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 10 years ago by Akzhan

Additional remark:

visibility CSS style attribute doesn't affect offsetWidth/offsetHeight properties.

comment:2 Changed 10 years ago by dmethvin

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:3 Changed 10 years ago by Akzhan

Ok, bug can be in wontfix state.

I'll update jQuery wiki.

comment:4 Changed 10 years ago by dmethvin

Resolution: wontfix
Status: newclosed
Note: See TracTickets for help on using tickets.