JS與HTML結(jié)合使用marquee標(biāo)簽實現(xiàn)無縫滾動效果代碼
來源:易賢網(wǎng) 閱讀:1730 次 日期:2016-07-26 14:41:45
溫馨提示:易賢網(wǎng)小編為您整理了“JS與HTML結(jié)合使用marquee標(biāo)簽實現(xiàn)無縫滾動效果代碼”,方便廣大網(wǎng)友查閱!

這篇文章主要介紹了JS與HTML結(jié)合使用marquee標(biāo)簽實現(xiàn)無縫滾動效果代碼的相關(guān)資料,非常不錯,具有參考借鑒價值,需要的朋友可以參考下

具體代碼如下所示:

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"

"http://www.w3c.org/TR/1999/REC-html401-19991224/loose.dtd">

<HTML xmlns="http://www.w3.org/1999/xhtml">

<HEAD>

<TITLE>一行多列文字循環(huán)滾動帶停頓-</TITLE>

<meta name="keywords" content="網(wǎng)頁特效" />

<meta name="description" content="" />

<META http-equiv=Content-Type content="text/html; charset=utf-8">

<style type="text/css">

ul {height:200px;

padding-right: 0px;

padding-left: 0px;

padding-bottom: 0px;

margin: 0px;

padding-top: 0px

}

#announcement {

width:300px;

height:200px;

background:url(img/menu_bg.gif) repeat;

overflow: hidden;

}

#announcement div {

border: #e6e6e6 1px solid;

padding:0px 10px 0px 10px;

overflow-y:hidden;

line-height: 24px;

height:100px;

}

#announcement li {

font-size: 12px;

float: left;

list-style-type: none;

margin-right: 20px;

padding-left: 10px;

background: url(img/arrow_right.gif) no-repeat 0px 50%;

white-space: nowrap

}

#announcement a {

text-decoration: none;

}

#announcement a:hover {

text-decoration:underline;

}

</style>

</HEAD>

<BODY>

<DIV id="announcement" onMouseOver="if(!anncount) {clearTimeout(annst);annst = 0}" onMouseOut="if(!annst) annst = setTimeout('announcementScroll()', anndelay);">

<DIV id="scrbody">

<ul>

<li>

<a href="#" target="_blank">jQuery 類似騰訊網(wǎng)的圖片幻燈特效(可自動播放)</a>

</li>

<li>

<a href="#/JS" target="_blank">VB版增強型Windows任務(wù)管理器</a>

</li>

<li>

<a href="#/JS/texiao"target="_blank">JQuery Tip多風(fēng)格鏈接提示框</a>

</li>

<li>

<a href="#/JS/ad" target="_blank">VC++動態(tài)加載、調(diào)用smtp.dll發(fā)郵件示例</a>

</li>

<li>

<a href="#/html+css" target="_blank">++連連看游戲源碼附外掛</a>

</li>

<li>

<a href="#/" target="_blank">基于API的VB HOOK鉤子攔截程序</a>

</li>

<li>

<a href="#/" target="_blank">VB 操作系統(tǒng)的一些常用小技巧集</a>

</li>

<li>

<a href="#/js" target="_blank">xTree 標(biāo)準(zhǔn)的WEB菜單樹(樹形菜單)</a>

</li>

</ul>

</DIV>

</DIV>

<script type="text/javascript">

function $(id)

{

return document.getElementById(id);

}

var anndelay = 3000;

var anncount = 0;

var annheight = 24;

var annst = 0;

function announcementScroll()

{

if( ! annst)

{

$('scrbody').innerHTML += '<br style="clear: both" />' +

$('scrbody').innerHTML;

$('scrbody').scrollTop = 0;

if($('scrbody').scrollHeight > annheight * 3)

{

annst = setTimeout('announcementScroll()', anndelay);

}

else

{

$('announcement').onmouseover = $('announcement').onmouseout = null;

}

return;

}

if(anncount == annheight)

{

if($('scrbody').scrollHeight - annheight <= $('scrbody').scrollTop)

{

$('scrbody').scrollTop = $('scrbody').scrollHeight / 2 - annheight;

}

anncount = 0;

annst = setTimeout('announcementScroll()', anndelay);

}

else

{

$('scrbody').scrollTop ++ ;

anncount ++ ;

annst = setTimeout('announcementScroll()', 10);

}

}

announcementScroll();

</script>

</BODY>

</HTML>

以上所述是小編給大家介紹的JS與HTML結(jié)合使用marquee標(biāo)簽實現(xiàn)無縫滾動效果代碼,希望對大家有所幫助

更多信息請查看網(wǎng)絡(luò)編程
由于各方面情況的不斷調(diào)整與變化,易賢網(wǎng)提供的所有考試信息和咨詢回復(fù)僅供參考,敬請考生以權(quán)威部門公布的正式信息和咨詢?yōu)闇?zhǔn)!
關(guān)于我們 | 聯(lián)系我們 | 人才招聘 | 網(wǎng)站聲明 | 網(wǎng)站幫助 | 非正式的簡要咨詢 | 簡要咨詢須知 | 加入群交流 | 手機站點 | 投訴建議
工業(yè)和信息化部備案號:滇ICP備2023014141號-1 云南省教育廳備案號:云教ICP備0901021 滇公網(wǎng)安備53010202001879號 人力資源服務(wù)許可證:(云)人服證字(2023)第0102001523號
云南網(wǎng)警備案專用圖標(biāo)
聯(lián)系電話:0871-65317125(9:00—18:00) 獲取招聘考試信息及咨詢關(guān)注公眾號:hfpxwx
咨詢QQ:526150442(9:00—18:00)版權(quán)所有:易賢網(wǎng)
云南網(wǎng)警報警專用圖標(biāo)