當前位置:股票大全官網 - 財經新聞 - 騰訊網中的即時新聞滾動怎麽實現

騰訊網中的即時新聞滾動怎麽實現

把中間的圖片換成新聞

<div id=demo30 style="MARGIN-TOP: 0px;OVERFLOW: hidden; WIDTH: 200px; HEIGHT: 440px;">

<div id=demo40 style="LINE-HEIGHT: 23px; width:100%;">

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

<tr>

<td align="left"><a href="" target="_blank"><img src="/t/image_category/res/Gangtai/Xu_Xi_Yuan.jpg" onmouseover="this.width='190';this.height=230" onmouseout="this.width='95';this.height=115" border="0" /></a></td></tr><tr>

<td align="left"><a href="" target="_blank"><img src="/t/image_category/res/Gangtai/Yang_Cheng_Lin.jpg" onmouseover="this.width='190';this.height=230" onmouseout="this.width='95';this.height=115" border="0"/></a></td></tr><tr>

<td align="left"><a href="" target="_blank"><img src="/t/image_category/res/Gangtai/Ye_Xuan.jpg" onmouseover="this.width='190';this.height=230" onmouseout="this.width='95';this.height=115" border="0"/></a></td></tr><tr>

<td align="left"><a href="" target="_blank"><img src="/t/image_category/res/Gangtai/Zhang_Bai_Zhi.jpg" onmouseover="this.width='190';this.height=230" onmouseout="this.width='95';this.height=115" border="0"/></a></td></tr>

</table></div>

<div id=demo50></div>

</div>

<SCRIPT>

var speed=60;

var demo50=document.getElementById("demo50");

var demo40=document.getElementById("demo40");

var demo30=document.getElementById("demo30");

demo50.innerHTML=demo40.innerHTML

function Marquee(){

if(demo50.offsetTop-demo30.scrollTop<=0)

demo30.scrollTop-=demo40.offsetHeight;

else{

demo30.scrollTop++;

}

}

var MyMar=setInterval(Marquee,speed);

demo30.onmouseover=function() {clearInterval(MyMar)}

demo30.onmouseout=function() {MyMar=setInterval(Marquee,speed)}

</SCRIPT>