一、纯javascript
<div id="marqueey" align=center> 要滚动的内容 </div> <script language="JavaScript"> marqueeyHeight=120; //滚动高度控制 stopscroll=false; with(marqueey){ style.width=0; style.height=marqueeyHeight; style.overflowX="visible"; style.overflowY="hidden"; noWrap=true; onmouseover=new Function("stopscroll=true"); onmouseout=new Function("stopscroll=false"); } document.write('<div id="templayer" style="position:absolute;z-index:1;visibility:hidden"></div>'); preTop=0; currentTop=0; function init(){ templayer.innerHTML=""; while(templayer.offsetHeight<marqueeyHeight){ templayer.innerHTML+=marqueey.innerHTML; } marqueey.innerHTML=templayer.innerHTML+templayer.innerHTML; setInterval("scrollUp()",80); //滚动速度控制,越大越慢 } document.body.onload=init; function scrollUp(){ if(stopscroll==true) return; preTop=marqueey.scrollTop; marqueey.scrollTop+=1; if(preTop==marqueey.scrollTop){ marqueey.scrollTop=templayer.offsetHeight-marqueeyHeight; marqueey.scrollTop+=1; } } </script>
|
二、用flash播放的图片新闻
用flash播放的图片新闻.rar
三、用flash播放的图片新闻支持多个参数
用flash播放的图片新闻支持多个参数.rar