琪琪资源网 首页 站长学院 网站设计 查看内容

DHTML轮显效果

2020-6-29 18:48
来自: 互联网 收藏 邀请

HTMLstyle!--#ticker{ width:800px; line-height:1.2em; background-color:lightblue;}--/stylescript language="JavaScript1.2"//configure tickercontents to set the messges you wish be displayed (HTML codes ...

<HTML>

<style>

<!--

#ticker

{

  width:800px;

  line-height:1.2em;

  background-color:lightblue;

}

-->

</style>

<script language="JavaScript1.2">

//configure tickercontents[] to set the messges you wish be displayed (HTML codes accepted)//设置内容显示

var tickercontents=new Array()

tickercontents[0]='See what's New at Dynamic Drive. <a href="../../../dynamicdrive.com/new.htm">[Read more]</a>'

tickercontents[1]='Browse the most popular scripts on Dynamic Drive <a href="../../../dynamicdrive.com/hot.htm">[Read more]</a>'

tickercontents[2]='Link back to Dynamic Drive! <a href="../../../dynamicdrive.com/link.htm">[Read more]</a>'



//configure the below variable to determine the delay between ticking of messages (in miliseconds//设置延迟时间

var tickdelay=3000



////Do not edit pass this line////////////////



var currentmessage=0



function changetickercontent(){

ticker.innerHTML=tickercontents[currentmessage]



if (currentmessage==tickercontents.length-1) currentmessage=0

else currentmessage++

setTimeout("changetickercontent()",tickdelay)

}



function start_ticking(){

  changetickercontent()

}



window.onload=start_ticking

</script>

<div id="ticker"left=0 top=0></div>

</HTML>

鲜花

握手

雷人

路过

鸡蛋
粉丝 阅读30 回复0
上一篇:
网页设计中HTML常犯的五个错误发布时间:2020-06-29
下一篇:
与HTML相比XHTML有什么特点?发布时间:2020-06-29
琪琪素材专注素材教程免费分享
免费客服QQ咨询

13335039

周一至周日9:00-23:00

反馈建议

admin@77code.com 在线QQ咨询

扫描二维码关注我们

Powered by 琪琪素材网 © 2020 Qiqisucai Inc.