單行文字向上跑馬燈滾動顯示

來源:互聯網
上載者:User

有時候我們需要在網站某個小角落或者顯著的位置加一條連結,但是當同類連結越來越多的時候,我們就需要將連結滾動顯示,這裡的滾動不是我們平常所說公告欄滾動效果,而是滾動一行停留一段時間再滾動下一行的看似一幀一幀切換的效果。代碼如下:<br /><html><br /><head><br /><mce:script type="text/javascript"><!--<br />function startmarquee(lh,speed,delay) {<br />var p=false;<br />var t;<br />var sh;<br />var o=document.getElementById("marqueebox");<br />o.innerHTML+=o.innerHTML;<br />o.style.marginTop=0;<br />o.onmouseover=function(){p=true;}<br />o.onmouseout=function(){p=false;}<br />function start(){<br />sh = o.offsetHeight;<br />o.style.height = sh;<br />t=setInterval(scrolling,speed);<br />if(!p) o.style.marginTop=parseInt(o.style.marginTop)-1+"px";<br />}<br />function scrolling(){<br />if(parseInt(o.style.marginTop)%lh!=0){<br />o.style.marginTop=parseInt(o.style.marginTop)-1+"px";<br />if(Math.abs(parseInt(o.style.marginTop))>=sh/2) o.style.marginTop=0;<br />}else{<br />clearInterval(t);<br />setTimeout(start,delay);<br />}<br />}<br />setTimeout(start,delay);<br />}<br />// --></mce:script><br /></head><br /><body><br /><div style="overflow: hidden; height: 18px; margin-left: 5px;"><br /><div id="marqueebox" style="margin-top: -48px; height: 252px;"><br /><div class="tp"><a target="_blank" href="http://tk.baidu.com/tk-rcv/sv/click.php?trid=1542&tu=aHR0cDovL3lvdWEuYmFpZHUuY29tLw%3D%3D&std=21" mce_href="http://tk.baidu.com/tk-rcv/sv/click.php?trid=1542&tu=aHR0cDovL3lvdWEuYmFpZHUuY29tLw%3D%3D&std=21">超值商品熱賣</a></div><br /><div class="tp"><a target="_blank" href="http://365.baidu.com" mce_href="http://365.baidu.com">藍天365</a></div><br /><div class="tp"><a target="_blank" href="http://xiangcun.baidu.com/" mce_href="http://xiangcun.baidu.com/">五千萬等你拿</a></div><br /><div class="tp"><a target="_blank" href="http://x.baidu.com/" mce_href="http://x.baidu.com/">搜尋開放平台</a></div><br /><div class="tp"><a target="_blank" href="http://umaz.baidu.com/shijie/2009-07-24/163839232171.html" mce_href="http://umaz.baidu.com/shijie/2009-07-24/163839232171.html">網路遊戲營銷</a></div><br /><div class="tp"><a target="_blank" href="http://umaz.baidu.com/guandian/2009-08-04/171646233451.html" mce_href="http://umaz.baidu.com/guandian/2009-08-04/171646233451.html">網遊使用者價值</a></div><br /><div class="tp"><a target="_blank" href="http://umaz.baidu.com/guandian/2009-07-22/170338231885.html" mce_href="http://umaz.baidu.com/guandian/2009-07-22/170338231885.html">網吧經營方法</a></div><br /></div><br /></div><br /></body><br /><mce:script type="text/javascript"><!--<br />startmarquee(18,20,3000);<br />// --></mce:script><br /></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.