如何在页面加载后删除或隐藏 div
how to remove or hide div after page loading
这个 div 加载后添加到我的网页源。我可以使用一些代码来隐藏或删除它吗?
<div style="border-right: #c6c8ca 1px solid; border-top: #c6c8ca 1px solid; left: 0px;z-index: 4000; border-left: #c6c8ca 1px solid; width: 485px; border-bottom: #c6c8ca 1px solid;position: absolute; top: 0px; height: 60px; background-color: #e9e9e9" id="divADV">
<table border="0" cellpadding="0" cellspacing="0" width="485">
<tbody>
<tr>
<td style="width:468px" id="tdAdv">
<iframe id="a3b67f12" name="a3b67f12" src="http://ads.adsready.com/www/delivery/afr.php?zoneid=9&target=_blank" scrolling="no" style="z-index:4000; width:468px; height:60px; margin:0" allowtransparency="true" frameborder="0">
<a href="http://ads.adsready.com/www/delivery/ck.php?n=a8fcf057" target="_blank"><img src="http://ads.adsready.com/www/delivery/avw.php?zoneid=9&n=a8fcf057" border="0" />
</a>
</iframe>
<iframe style="width:1px; height:1px; margin:0; visibility:hidden;" src="http://persianbox.com/s.aspx?pscn=2&pscr=moured.persianblog.ir&psct=&psep=1" scrolling="no" target="_top" frameborder="0"></iframe>
</td>
<td style="width:16px; text-align:center; vertical-align:top"><img alt="close" src="http://persianbox.com/close.gif" id="imgClose" onclick="javascript:closeWindow();" style="cursor: hand">
</td>
</tr>
</tbody>
</table>
与Jquery:
$("#divADV").hide()
或普通 javascript:
document.getElementById(divADV).style.display = 'none';
但你最好在 css:
中这样做
#divADV{
display: none;
}
这里你的目标 div 将在 3 秒后隐藏。您可以将其设置为 2 或 1 秒或设置 0 以在加载后通过更改值
隐藏
$(document).ready(function() {
$('#targetDiv').delay(3000).hide();
});
这个 div 加载后添加到我的网页源。我可以使用一些代码来隐藏或删除它吗?
<div style="border-right: #c6c8ca 1px solid; border-top: #c6c8ca 1px solid; left: 0px;z-index: 4000; border-left: #c6c8ca 1px solid; width: 485px; border-bottom: #c6c8ca 1px solid;position: absolute; top: 0px; height: 60px; background-color: #e9e9e9" id="divADV">
<table border="0" cellpadding="0" cellspacing="0" width="485">
<tbody>
<tr>
<td style="width:468px" id="tdAdv">
<iframe id="a3b67f12" name="a3b67f12" src="http://ads.adsready.com/www/delivery/afr.php?zoneid=9&target=_blank" scrolling="no" style="z-index:4000; width:468px; height:60px; margin:0" allowtransparency="true" frameborder="0">
<a href="http://ads.adsready.com/www/delivery/ck.php?n=a8fcf057" target="_blank"><img src="http://ads.adsready.com/www/delivery/avw.php?zoneid=9&n=a8fcf057" border="0" />
</a>
</iframe>
<iframe style="width:1px; height:1px; margin:0; visibility:hidden;" src="http://persianbox.com/s.aspx?pscn=2&pscr=moured.persianblog.ir&psct=&psep=1" scrolling="no" target="_top" frameborder="0"></iframe>
</td>
<td style="width:16px; text-align:center; vertical-align:top"><img alt="close" src="http://persianbox.com/close.gif" id="imgClose" onclick="javascript:closeWindow();" style="cursor: hand">
</td>
</tr>
</tbody>
</table>
与Jquery:
$("#divADV").hide()
或普通 javascript:
document.getElementById(divADV).style.display = 'none';
但你最好在 css:
中这样做#divADV{
display: none;
}
这里你的目标 div 将在 3 秒后隐藏。您可以将其设置为 2 或 1 秒或设置 0 以在加载后通过更改值
隐藏$(document).ready(function() {
$('#targetDiv').delay(3000).hide();
});