js實現拉幕效果的廣告代碼,js廣告代碼

來源:互聯網
上載者:User

js實現拉幕效果的廣告代碼,js廣告代碼

本文執行個體講述了js實現拉幕效果的廣告代碼。分享給大家供大家參考。具體如下:

這是一款拉幕效果的廣告代碼,廣告圖片像窗帘的幕布一樣慢慢的被拉上去了,縮小至一定大小後定格,目前來說,在一些大型的門戶網站中仍然可以見到這種效果。

運行效果如下:

線上示範地址如下:

http://demo.jb51.net/js/2015/js-lm-style-adv-pic-style-codes/

具體代碼如下:

<html><head><meta http-equiv="Content-Type" content="text/html; charset=gb2312" /><title>slide</title><style type="text/css"> html,body{ width:100%; height:100%; margin:0px; border:0px; text-align:center;}div{ margin:auto; overflow:hidden;}</style></head><body><script type="text/javascript"> function tag(obj){ return document.getElementsByTagName(obj)[0];}window.onload=function(){ setTimeout("slideUp();",1000);}function slideUp(){ if(tag("div").offsetHeight>0){  if(tag("div").offsetHeight>10){   tag("div").style.height=tag("div").offsetHeight-10+"px"   setTimeout("slideUp();",20);  }else{   tag("div").style.display="none";   tag("img").src="images/wall8.jpg";   tag("div").style.display="block";   slideDown();  } }}function slideDown(){ if(tag("div").offsetHeight<80){  if(tag("div").offsetHeight<70){   tag("div").style.height=tag("div").offsetHeight+10+"px";   setTimeout("slideDown();",20);  }else{   tag("div").style.height="80px";  } }}</script><div><img src="images/wall8.jpg"></div></body></html>

希望本文所述對大家的javascript程式設計有所協助。

聯繫我們

該頁面正文內容均來源於網絡整理,並不代表阿里雲官方的觀點,該頁面所提到的產品和服務也與阿里云無關,如果該頁面內容對您造成了困擾,歡迎寫郵件給我們,收到郵件我們將在5個工作日內處理。

如果您發現本社區中有涉嫌抄襲的內容,歡迎發送郵件至: info-contact@alibabacloud.com 進行舉報並提供相關證據,工作人員會在 5 個工作天內聯絡您,一經查實,本站將立刻刪除涉嫌侵權內容。

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.