您的位置:首页 > 其它

滚动公告(用数据绑定显示的方法)

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>
内容来自用户分享和网络整理,不保证内容的准确性,如有侵权内容,可联系管理员处理 点击这里给我发消息
标签: