澳门皇冠真人官网是一个网站架设的学习平台,提供最新的网站制作与网站运营等教程

动易CMS教程 单行标题循环滚动标签

来源:网络整理更新时间:2012-08-26 16:01点击:

当前位置:小祥子模板网 > 教程中心 > 程序教程 > 动易CMS教程 单行标题循环滚动标签

动易CMS教程 单行标题循环滚动标签

作者:佚名  来源:本站整理  发布时间:2012-08-22 12:55:04

查询语句:

select top 6 ArticleID,ChannelID,Title,DefaultPicUrl from PE_Article where ChannelID ={input(0)} and Elite =-1 and Status =3 order by ArticleID desc

参数列表:

频道

标签内容:

<script>
var marqueeContent=new Array();
{Loop}
{Infobegin}
marqueeContent[0]='<a href="{$InstallDir}{$Field(0,GetUrl,Article,1)}" target="_blank">{$Field(2,Text,0,0,0)}</a><br>'
{Infoend}{Infobegin}
marqueeContent[1]='<a href="{$InstallDir}{$Field(0,GetUrl,Article,1)}" target="_blank">{$Field(2,Text,0,0,0)}</a><br>'
{Infoend}{Infobegin}
marqueeContent[2]='<a href="{$InstallDir}{$Field(0,GetUrl,Article,1)}" target="_blank">{$Field(2,Text,0,0,0)}</a><br>'
{Infoend}{Infobegin}
marqueeContent[3]='<a href="{$InstallDir}{$Field(0,GetUrl,Article,1)}" target="_blank">{$Field(2,Text,0,0,0)}</a><br>'
{Infoend}{Infobegin}
marqueeContent[4]='<a href="{$InstallDir}{$Field(0,GetUrl,Article,1)}" target="_blank">{$Field(2,Text,0,0,0)}</a><br>'
{Infoend}{Infobegin}
marqueeContent[5]='<a href="{$InstallDir}{$Field(0,GetUrl,Article,1)}" target="_blank">{$Field((2,Text,0,0,0)}</a><br>'
{Infoend}{Infobegin}
marqueeContent[6]='<a href="{$InstallDir}{$Field(0,GetUrl,Article,1)}" target="_blank">{$Field(2,Text,0,0,0)}</a><br>'
{Infoend}
{/Loop}


var marqueeInterval=new Array();
var marqueeId=0;
var marqueeDelay=3000;
var marqueeHeight=18;
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(document.getElementById("marqueeBox").childNodes.length==1) {
 var nextLine=document.createElement('DIV');
 nextLine.innerHTML=str;
 document.getElementById("marqueeBox").appendChild(nextLine);
 }
 else {
  document.getElementById("marqueeBox").childNodes[0].innerHTML=str;
  document.getElementById("marqueeBox").appendChild(document.getElementById("marqueeBox").childNodes[0]);
  document.getElementById("marqueeBox").scrollTop=0;
 }
 clearInterval(marqueeInterval[1]);
 marqueeInterval[1]=setInterval("scrollMarquee()",20);
}
function scrollMarquee() {
 document.getElementById("marqueeBox").scrollTop++;
 if(document.getElementById("marqueeBox").scrollTop%marqueeHeight==(marqueeHeight-1)){
 clearInterval(marqueeInterval[1]);
 }
}
</script>
<table width="100%" border="0" cellspacing="0" cellpadding="0" class="title"><tr><td><script>initMarquee()</script></td></tr></table>

  • 上一篇文章:dedecms 添加广告位的方法
  • 下一篇文章:动易CMS教程 取消用户登录提示自动返回
  • 相关搜索:

    本站推荐