Bug Tracker

Modify

Ticket #4223 (closed bug: wontfix)

Opened 4 years ago

Last modified 4 years ago

: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:
Blocking: Blocked by:

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

comment:1 Changed 4 years ago by Akzhan

Additional remark:

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

comment:2 Changed 4 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 4 years ago by Akzhan

Ok, bug can be in wontfix state.

I'll update jQuery wiki.

comment:4 Changed 4 years ago by dmethvin

  • Status changed from new to closed
  • Resolution set to wontfix

Please follow the  bug reporting guidlines and use  jsFiddle when providing test cases and demonstrations instead of pasting the code in the ticket.

View

Add a comment

Modify Ticket

Action
as closed
Author


E-mail address and user name can be saved in the Preferences.

 
Note: See TracTickets for help on using tickets.