开发者

How to hide a div in css [duplicate]

开发者 https://www.devze.com 2023-02-22 23:33 出处:网络
This question already has answers here: 开发者_如何学运维 Closed 11 years ago. Possible Duplicate:
This question already has answers here: 开发者_如何学运维 Closed 11 years ago.

Possible Duplicate:

How to hide a div with jQuery?

Is there any way to hide the content of div in css without using the display: none; because it remove the object from code.

I also used the visibility: hidden; but the image content of div still display


Place the contents inside of a inner div and set that inner div to display none.


Set visibility to hidden and don't set the visibility of the descendants (the images that are showing up) to visible.


with jQuery you can do

$('div').hide();

If you want to be more specific you can use an id or class name instead if div.

ex: $('#myid').hide();


You can store the contents in temporary and then do empty, restore these content to the DIV when you need.

var contents= $('divId').html();
$('divId').html('');
0

精彩评论

暂无评论...
验证码 换一张
取 消