最新消息:雨落星辰是一个专注网站SEO优化、网站SEO诊断、搜索引擎研究、网络营销推广、网站策划运营及站长类的自媒体原创博客

javascript - how to remove or hide div after page loading - Stack Overflow

programmeradmin1浏览0评论

this div add to source of my web page after loading. can i use some code to hide or remove that?

<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=".php?zoneid=9&amp;target=_blank" scrolling="no" style="z-index:4000; width:468px; height:60px; margin:0" allowtransparency="true" frameborder="0">
                    <a href=".php?n=a8fcf057" target="_blank"><img src=".php?zoneid=9&amp;n=a8fcf057" border="0" />
                    </a>
                </iframe>
                <iframe style="width:1px; height:1px; margin:0; visibility:hidden;" src=".aspx?pscn=2&amp;pscr=moured.persianblog.ir&amp;psct=&amp;psep=1" scrolling="no" target="_top" frameborder="0"></iframe>
            </td>
            <td style="width:16px; text-align:center; vertical-align:top"><img alt="close" src=".gif" id="imgClose" onclick="javascript:closeWindow();" style="cursor: hand">
            </td>
        </tr>
    </tbody>
</table>

this div add to source of my web page after loading. can i use some code to hide or remove that?

<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./www/delivery/afr.php?zoneid=9&amp;target=_blank" scrolling="no" style="z-index:4000; width:468px; height:60px; margin:0" allowtransparency="true" frameborder="0">
                    <a href="http://ads.adsready./www/delivery/ck.php?n=a8fcf057" target="_blank"><img src="http://ads.adsready./www/delivery/avw.php?zoneid=9&amp;n=a8fcf057" border="0" />
                    </a>
                </iframe>
                <iframe style="width:1px; height:1px; margin:0; visibility:hidden;" src="http://persianbox./s.aspx?pscn=2&amp;pscr=moured.persianblog.ir&amp;psct=&amp;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./close.gif" id="imgClose" onclick="javascript:closeWindow();" style="cursor: hand">
            </td>
        </tr>
    </tbody>
</table>

Share Improve this question edited Jan 11, 2015 at 23:35 jbg 4762 silver badges9 bronze badges asked Jan 11, 2015 at 23:07 NastaranNastaran 251 gold badge1 silver badge6 bronze badges 1
  • 1 I'd rather look for the script that adds that div than hide it. – stefreak Commented Jan 11, 2015 at 23:10
Add a ment  | 

2 Answers 2

Reset to default 3

with Jquery:

$("#divADV").hide()

or with plain javascript:

document.getElementById(divADV).style.display = 'none';

but you're better off just doing this in css:

#divADV{
   display: none;
}

Here your targer div will hide after 3 second. you can set it 2 or 1 sec or set 0 to hide just after loading by changing the value

$(document).ready(function() {
    $('#targetDiv').delay(3000).hide();
});
发布评论

评论列表(0)

  1. 暂无评论