文字垂直滾動之javascript代碼,滾動javascript代碼

來源:互聯網
上載者:User

文字垂直滾動之javascript代碼,滾動javascript代碼

在大型的網站新聞公告和友情連結等領域經常有這種文字或圖片垂直滾動的效果,下面就介紹一下文字垂直滾動的javascript代碼。

javascript代碼如下:

<!DOCTYPE html><html><head><meta charset="utf-8"><meta name="author" content="http://www.bkjia.com/" /><title>幫客之家</title><style> a {  display:block;  font-size:15px;  line-height:18px;  text-decoration:none;  color:#333;  font-family:Arial;  font-size:12px; } .main{  background:no-repeat 4px 5px;  border:1px solid #aaa;  width:400px;  padding:3px 2px 2px 20px; } #thediv{  height:36px;  overflow:hidden; } </style><script type="text/javascript">var c, _ = Function;window.onload=function(){  with (o = document.getElementById("thediv")){  innerHTML += innerHTML; onmouseover = _("c=1"); onmouseout = _("c=0"); }  (F=_("if(#%18||!c)#++,#%=o.scrollHeight>>1;setTimeout(F,#%18?10:3000);".replace(/#/g,"o.scrollTop")))(); }</script> </head> <body> <div class="main"> <div id="thediv">  <a>螞蟻部落歡迎您</a>  <a>只有奮鬥才會有好的結果</a>  <a>高手都是從菜鳥成長而來</a>  <a>太陽馬上就要出來了</a>  </div> </div> </body> </html>

以上代碼就實現了文字垂直滾動的效果,文字可有上下間歇性的滾動,有需要的朋友可以來參考下,希望大家喜歡。

聯繫我們

該頁面正文內容均來源於網絡整理,並不代表阿里雲官方的觀點,該頁面所提到的產品和服務也與阿里云無關,如果該頁面內容對您造成了困擾,歡迎寫郵件給我們,收到郵件我們將在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.