我有一个div
这样的:如何隐藏一个div,如果它不包含一个表里面
<div class="EventsRollup">
<span class="EventsRollupTitle">Health Lecture Events</span>
<!--this is where a table would be dynamically inserted by sharepoint
based on some filter, if filter is true, a tabel will get in there,
else not-->
</div>
使用jQuery,我怎么躲整个div
如果没有table
插入,因为div
有背景颜色和空背景颜色显示没有table
的内容?
它的工作原理,但它确实显示快如秒的div,然后隐藏它使页面闪烁..如何防止? –
@AnjuThapa,默认情况下使用一些CSS隐藏它。 'display:none;' –
@AnjuThapa:Xeon06是对的。你最好隐藏CSS中的所有'.EventsRollup'元素,然后显示那些*有*表的元素。 $('。EventsRollup')。has('table')。show()'或'$('。EventsRollup:has(table)')。show()' – 2011-12-22 16:20:18