jQuery after show() assumes that display:inline is :hidden. Why?
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 som开发者_如何转开发ething? 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).
Your code would be correct assuming the .show()
happened linearly. However .show()
starts an animation that ends with the object being shown. If you would like to execute code after it has shown use the alternative form with a animation length and a callback .show(100,function(){})
.
精彩评论