文字滚动消息广告代码 - 小武站
管理员 系统 关注 创始人 10级
发表于NEW版块 PHP源码

文字滚动消息广告代码

<head>

<meta http-equiv="Content-Type" content="text/html; charset=gb2312">

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

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

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

<title>文字滚动消息广告代码</title>

<style type="text/css">

td {font-size: 12px;}

</style>

</head>


<body>

<table width="400" border="0" align="center" cellpadding="0" cellspacing="0">

  <tr>

    <td width="15" valign="top"><img src="images/news.gif" alt="" width="11" height="11" /></td>

    <td width="64">滚动消息:</td>

    <td width="321"><script>

var marqueeContent=new Array();   //滚动主题

                 

marqueeContent[0]='<a href="https://www.365jz.com/" target="_blank">+ 学会偷懒,并懒出境界是提高工作效率最有效的方法!</a>';

marqueeContent[1]='<a href="https://www.365jz.com/" target="_blank">+ 显而易见,最高的效率就是对现有材料的最佳利用。</a>';

marqueeContent[2]='<a href="https://www.365jz.com/" target="_blank">+ 自己能解决的事,别花钱,花钱能解决的事,别求人。</a>';

marqueeContent[3]='<a href="https://www.365jz.com/" target="_blank">+ 旅行是需要一种心情,更重要的是,需要一种冲动。</a>';

marqueeContent[4]='<a href="https://www.365jz.com/" target="_blank">+ 随时用零碎的时间(如等人、排队等)做零碎的事情。</a>';


var marqueeInterval=new Array();  //定义一些常用而且要经常用到的变量

var marqueeId=0;

var marqueeDelay=4000;

var marqueeHeight=15;

function initMarquee() {

 var str=marqueeContent[0];

 document.write('<div id=marqueeBox style="overflow:hidden;height:'+marqueeHeight+'px" onmouseover="clearInterval(marqueeInterval[0])" onmouseout="marqueeInterval[0]=setInterval(\'startMarquee()\',marqueeDelay)"><div>'+str+'</div></div>');

 marqueeId++;

 marqueeInterval[0]=setInterval("startMarquee()",marqueeDelay);

 }

function startMarquee() {

 var str=marqueeContent[marqueeId];

  marqueeId++;

 if(marqueeId>=marqueeContent.length) marqueeId=0;

 if(marqueeBox.childNodes.length==1) {

  var nextLine=document.createElement('DIV');

  nextLine.innerHTML=str;

  marqueeBox.appendChild(nextLine);

  }

 else {

  marqueeBox.childNodes[0].innerHTML=str;

  marqueeBox.appendChild(marqueeBox.childNodes[0]);

  marqueeBox.scrollTop=0;

  }

 clearInterval(marqueeInterval[1]);

 marqueeInterval[1]=setInterval("scrollMarquee()",10);

 }

function scrollMarquee() {

 marqueeBox.scrollTop++;

 if(marqueeBox.scrollTop%marqueeHeight==marqueeHeight){

  clearInterval(marqueeInterval[1]);

  }

 }

initMarquee();

</script></td>

  </tr>

</table>

</body>

</html>

福建,厦门,集美区

已有0次打赏
(1) 分享
分享

请保存二维码或复制链接进行分享

取消