我正在寻找使网站上的一段时间后照片出现的代码。这个代码我希望在网站上显示一定的时间:
<div style="float:left;"><a href="https://www.2checkout.com/checkout/purchase?sid=1401348&quantity=1&product_id=8" rel="nofollow""><img src="http://www.interestingquestionstoaskagirl.msl37.org/wp-content/esg7/m-12.gif" title="" width="148" height="25" class="alignnone size-full wp-image-155" /></a></div>
<div style="float:right;"><a href="http://www.msl37.org/wp-content/d/5.htm" rel="nofollow"><img src="http://www.interestingquestionstoaskagirl.msl37.org/wp-content/esg7/kas-34.jpg" title="" width="148" height="25" class="alignnone size-full wp-image-160" /></a></div>
我对JavaScript或网络开发没有经验,希望你能帮助我。 感谢提前
答案 0 :(得分:3)
你可以这样做(demo =&gt; http://jsfiddle.net/steweb/EqZ88/):
将HTML包装在包装器div中,即
<div id="wrapper">
<div style="float:left;"><a href="https://www.2checkout.com/checkout/purchase?sid=1401348&quantity=1&product_id=8" rel="nofollow"><img src="http://www.interestingquestionstoaskagirl.msl37.org/wp-content/esg7/m-12.gif" title="" width="148" height="25" class="alignnone size-full wp-image-155" /></a></div>
<div style="float:right;"><a href="http://www.msl37.org/wp-content/d/5.htm" rel="nofollow"><img src="http://www.interestingquestionstoaskagirl.msl37.org/wp-content/esg7/kas-34.jpg" title="" width="148" height="25" class="alignnone size-full wp-image-160" /></a></div>
</div>
然后添加此css规则
#wrapper{
display:none; /*wrapper and its content does not appear when user loads the page */
}
最后,通过javascript,让它们在几秒钟后出现(5即)
setTimeout(function(){
document.getElementById('wrapper').style.display = "block";
},5000);
P.S。标记中第一个"
元素末尾还有一个a