问题描述
基本的jQuery问题:
我试图揭示一个使用jQuery标记为隐藏的 div
。但我没有完全理解它
我在这里创建了一个JSFiddle:
基本上,我想用 style =visibility:hidden;
而不是 style =display:none;
,因为我想隐藏元素的空间被保留
已尝试使用,等,但都不工作(他们为 style =display:none;做的
)
我做错了什么?
如果你已经用 visibility:hidden
隐藏它,那么你可以显示它用jQuery开发
$(。Deposit)。css('visibility','visible');
而在小提琴中,您错过了jQuery。 以下是一个演示:
Basic jQuery question:
I am trying to reveal a div
that has been marked as hidden using jQuery. But am not quite getting it
I've created a JSFiddle here: http://jsfiddle.net/VwjxJ/
Basically, I want to use style="visibility: hidden;"
rather than style="display: none;"
as I want the space of the hidden element to be maintained
Have tried using show()
, fadeIn()
etc but neither work (they do for style="display: none;"
)
what am I doing wrong?
If you have hidden it with visibility:hidden
then you can show it with jQuery by
$(".Deposit").css('visibility', 'visible');
And in the fiddle you are missing jQuery. Here is a demo: http://jsfiddle.net/9Z6nt/20/
这篇关于jquery .show()不会透露具有隐藏可见性的div的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!