Bug Tracker

Opened 10 years ago

Last modified 10 years ago

#9336 closed enhancement

:hidden doesn't check for opacity: 0 — at Version 9

Reported by: lonesomeday Owned by:
Priority: low Milestone: 1.7
Component: effects Version: 1.6.1
Keywords: needsreview, 1.7-discuss Cc:
Blocked by: Blocking:

Description (last modified by john)

The logical way to prepare an element to be faded in using fadeIn is by setting the opacity style to 0. However, invoking is(':hidden') on an element with opacity 0 returns false, unless hidden by display: none.

jsFiddle example

StackOverflow question

It would be useful if the :hidden filter checked the opacity setting.

Change History (9)

comment:1 Changed 10 years ago by Rick Waldron

Component: unfiledeffects
Keywords: needsreview added
Status: newopen

Technically, this is all correct - but I see the conundrum. Marking "needsreview" for further bike-shedding.

comment:2 Changed 10 years ago by john

Keywords: 1.7-discuss added

Nominating ticket for 1.7 discussion.

comment:3 Changed 10 years ago by Rick Waldron

Description: modified (diff)

+0, This needs discussion

comment:4 Changed 10 years ago by jaubourg

-1, It's exactly as documented. The element takes space and should be considered hidden.

comment:5 Changed 10 years ago by timmywil

-1, It is not "hidden" if visibility: hidden either.

comment:6 Changed 10 years ago by paul.irish

Description: modified (diff)

-1, that'd be more of an :invisible as the element still takes up space, just like with visibility:hidden

The dimensions == 0 check is expected by users nowadays.

comment:7 Changed 10 years ago by dmethvin

-1, If we do opacity:0 then what about top:-10000px;left:-10000px as well? I don't think we can change the standard to visible to human eyeballs and the docs are already clear on what we mean.

Last edited 10 years ago by dmethvin (previous) (diff)

comment:8 Changed 10 years ago by lonesomeday

I understand the reasoning for not having it as part of the hidden filter. Is there an argument for adding the check to the fadeIn/fadeOut/fadeToggle methods instead? That's the main utility I see this as having.

comment:9 Changed 10 years ago by john

Description: modified (diff)

-1, Different semantics here.

Note: See TracTickets for help on using tickets.