Is there any thing similar to the css property and value visibility: hidden in jQuery? The hide function doesn't maintain the space.
Asked
Active
Viewed 1,233 times
2 Answers
3
If you want the same effect as visiblity: hidden
, then use that.
$('some selector').css('visibility', 'hidden');
Or set the opacity to zero, if you're looking for something that you can animate:
$('some selector').animate({'opacity': 0}, 1000);

Matt Ball
- 354,903
- 100
- 647
- 710
0
JQuery is nothing more than a Javascript library, so if you know a way to do something with pure JS, then just do it. You don't have to rely on JQuery to do it. Both JS and JQuery have a way to get a DOM element and change its style attributes. Since Matt provided a JQuery answer, here is how it is done with pure Javascipt:
document.getElementById("id").style.visibility = "hidden";

RufusVS
- 4,008
- 3
- 29
- 40

Ognjen Koprivica
- 57
- 1
- 7