jQuery after show() assumes that display:inline is :hidden. Why?
Posted
by Janis Veinbergs
on Stack Overflow
See other posts from Stack Overflow
or by Janis Veinbergs
Published on 2010-06-14T15:25:38Z
Indexed on
2010/06/14
15:42 UTC
Read the original article
Hit count: 199
With jQuery 1.4.2, :hidden filter is not filtering out elements that were hidden, but i've made then visible by calling show(). Filter assumes it is still hidden.
Is this bug or am i missing something? Consider the following code:
$("td.ms-authoringcontrols > span[id*='_ParallelApprovers']:hidden:first").css("display")
"none"
$("td.ms-authoringcontrols > span[id*='_ParallelApprovers']:hidden:first").show()
Object
$("td.ms-authoringcontrols > span[id*='_ParallelApprovers']:hidden:first").css("display")
"inline" // ?? Let me scratch my head...
$("td.ms-authoringcontrols > span[id*='_ParallelApprovers']:hidden:first").is(":hidden")
true //element with "display:inline", visible in browser, but yet it is hidden
Instead of "inline", you would expect "none", because :hidden filter was used.
What it does is from an array of objects it selects first hidden element. Each time i call these lines of code, i expect them to select next hidden element (not the one i just showed).
© Stack Overflow or respective owner