jquery .show()不会透露具有隐藏可见性的div [英] Jquery .show() not revealing a div with visibility of hidden

查看:84
本文介绍了jquery .show()不会透露具有隐藏可见性的div的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

基本的jQuery问题:

我试图揭示一个使用jQuery标记为隐藏的 div 。但我没有完全理解它



我在这里创建了一个JSFiddle: http://jsfiddle.net/VwjxJ/



基本上,我想用 style =visibility:hidden; 而不是 style =display:none;,因为我想隐藏元素的空间被保留



已尝试使用 show() fadeIn() 等,但都不工作(他们为 style =display:none;做的



我做错了什么?

解决方案

如果你已经用 visibility:hidden 隐藏它,那么你可以显示它用jQuery开发

  $(。Deposit)。css('visibility','visible'); 

而在小提琴中,您错过了jQuery。 以下是一个演示: http://jsfiddle.net/9Z6nt/20/


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的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆