我有一個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