滚动公告(用数据绑定显示的方法)
2005-04-26 15:16
387 查看
<script>
<!--
function news_scroll(divid, height, arrStack)
{
this.ie = navigator.userAgent.indexOf('MSIE')>=0;
this.div = document.all[divid];
this.to=this.j=0;this.po=1;this.mflag=false;
this.st1=arrStack;
this.rolling=(height%2)?3:2;
this.up = height;
this.height = height;
this.down = 0-height;
this.start = news_scroll_start;
this.go = news_scroll_go;
this.gt = news_scroll_gt;
this.chgdata = news_scroll_chgdata;
this.chog = news_scroll_chog;
return this;
}
function news_scroll_start(objName) {
this.chgdata(1); this.chog(1,objName);
this.mflag = true;
}
function news_scroll_go(o)
{return this.div.all['e'+o];}
function news_scroll_gt()
{return this.ie?"pixelTop":"top";}
function news_scroll_chgdata(o)
{
var szhtml = "";
for(var idx=0; idx< this.st1.length; idx++)
szhtml += "<div style='height:"+this.height+"'>"+this.st1[idx]+"</div>";
for(var idx=0; idx< this.st1.length; idx++)
szhtml += "<div style='height:"+this.height+"'>"+this.st1[idx]+"</div>";
this.go(o).innerHTML = szhtml;
}
function news_scroll_chog(o,objName)
{
if (this.st1.length==0) return;
if (this.mflag)
eval("this.go(o).style."+this.gt()+"=parseInt(this.go(o).style."+this.gt()+")-"+this.rolling+";");
if (parseInt(eval("this.go(o).style."+this.gt())%this.height) == 0)
{
if( parseInt(eval("this.go(o).style."+this.gt())) == this.height*this.st1.length*-1)
eval("this.go(o).style."+this.gt()+"=0;");
setTimeout("news_scroll_settimeout("+o+",'"+objName+"')",4000);
}
else
setTimeout("news_scroll_settimeout("+o+",'"+objName+"')",1);
}
function news_scroll_settimeout(o,objName)
{ obj = eval(objName); obj.chog(o,objName); }
//-->
</script>
<TABLE id="Table5" cellSpacing="0" cellPadding="0" width="100%" border="0">
<TR>
<TD><STRONG>相关收藏:</STRONG></TD>
<TD>
<span id="Finance" style="BACKGROUND:none transparent scroll repeat 0% 0%;OVERFLOW:hidden;; WIDTH:expression(((document.body.offsetWidth*0.35)-100));CLIP:; WHITE-SPACE:nowrap;POSITION:relative;TOP:0px;HEIGHT:15px;TEXT-OVERFLOW:ellipsis"
onmouseover="objFinance.mflag=false" onmouseout="objFinance.mflag=true"><span id="e1" style="LEFT:0px;POSITION:absolute;TOP:0px;HEIGHT:15px">
</span><span id="e2" style="LEFT:0px;POSITION:absolute;TOP:15px;HEIGHT:15px"></span>
</span>
<DIV></DIV>
</TD>
</TR>
</TABLE>
<!--
function news_scroll(divid, height, arrStack)
{
this.ie = navigator.userAgent.indexOf('MSIE')>=0;
this.div = document.all[divid];
this.to=this.j=0;this.po=1;this.mflag=false;
this.st1=arrStack;
this.rolling=(height%2)?3:2;
this.up = height;
this.height = height;
this.down = 0-height;
this.start = news_scroll_start;
this.go = news_scroll_go;
this.gt = news_scroll_gt;
this.chgdata = news_scroll_chgdata;
this.chog = news_scroll_chog;
return this;
}
function news_scroll_start(objName) {
this.chgdata(1); this.chog(1,objName);
this.mflag = true;
}
function news_scroll_go(o)
{return this.div.all['e'+o];}
function news_scroll_gt()
{return this.ie?"pixelTop":"top";}
function news_scroll_chgdata(o)
{
var szhtml = "";
for(var idx=0; idx< this.st1.length; idx++)
szhtml += "<div style='height:"+this.height+"'>"+this.st1[idx]+"</div>";
for(var idx=0; idx< this.st1.length; idx++)
szhtml += "<div style='height:"+this.height+"'>"+this.st1[idx]+"</div>";
this.go(o).innerHTML = szhtml;
}
function news_scroll_chog(o,objName)
{
if (this.st1.length==0) return;
if (this.mflag)
eval("this.go(o).style."+this.gt()+"=parseInt(this.go(o).style."+this.gt()+")-"+this.rolling+";");
if (parseInt(eval("this.go(o).style."+this.gt())%this.height) == 0)
{
if( parseInt(eval("this.go(o).style."+this.gt())) == this.height*this.st1.length*-1)
eval("this.go(o).style."+this.gt()+"=0;");
setTimeout("news_scroll_settimeout("+o+",'"+objName+"')",4000);
}
else
setTimeout("news_scroll_settimeout("+o+",'"+objName+"')",1);
}
function news_scroll_settimeout(o,objName)
{ obj = eval(objName); obj.chog(o,objName); }
//-->
</script>
<TABLE id="Table5" cellSpacing="0" cellPadding="0" width="100%" border="0">
<TR>
<TD><STRONG>相关收藏:</STRONG></TD>
<TD>
<span id="Finance" style="BACKGROUND:none transparent scroll repeat 0% 0%;OVERFLOW:hidden;; WIDTH:expression(((document.body.offsetWidth*0.35)-100));CLIP:; WHITE-SPACE:nowrap;POSITION:relative;TOP:0px;HEIGHT:15px;TEXT-OVERFLOW:ellipsis"
onmouseover="objFinance.mflag=false" onmouseout="objFinance.mflag=true"><span id="e1" style="LEFT:0px;POSITION:absolute;TOP:0px;HEIGHT:15px">
</span><span id="e2" style="LEFT:0px;POSITION:absolute;TOP:15px;HEIGHT:15px"></span>
</span>
<DIV></DIV>
</TD>
</TR>
</TABLE>
相关文章推荐
- 前台用Gridview绑定数据时时间只显示 年月日 的方法
- 使用Repeater绑定数据,及提取显示数据进行操作的一点小方法!(模板列)
- datalist 的用法。也是增删改查,但是比较智能。用数据绑定的方式,可以有不同的显示方法,下面是对一个表的增删改查的参考代码
- WPF中ListView在不滚动数据的情况下只能取到当前显示的数据,取不到滚动条以下的数据解决方法
- datagrid绑定list没有数据 表头不显示的解决方法
- js调用xml数据显示div层上下滚动的公告
- datagrid绑定list没有数据 表头不显示的解决方法
- 编辑框根据显示数据自动垂直滚动到底端的方法
- DevExpress Report web 绑定数据后没有显示的解决方法
- 【工作记录0013】easyui中datagrid绑定,后台可读出数据,前台未显示的解决方法
- Android ListView数据绑定显示的三种解决方法
- gridview 绑定数据为空时,表头部分内容显示的解决方法
- Android ListView数据绑定显示的三种解决方法
- 数据绑定后显示的方法
- 基于WPF数据绑定的鼠标随动显示光标位置的方法
- 绑定GRIDVIEW时无数据显示表头方法
- Dropdown 绑定数据,显示“请选择”
- Stimulsoft Reports筛选数据来绑定显示2个报表
- 绑定数据时格式化bit类型的方法
- DataSource绑定DataTable.Select()显示system.data.DataRow问题解决的方法