| 一个滚动代码 |
|
| 作者:佚名 文章来源:动易科技 点击数: 更新时间:2006-11-8 15:53:14 |
|
|
只要把它的高和宽设好就行,
以下是代码片段: 〈div id="icefable1" valign="top" align="center" 〉 〈!--{$GetPicPhoto(3,0,true,0,20,false,false,0,2,2,160,110,30,40,Flase,1)}--〉 〈SCRIPT〉 marqueesHeight=576//189;滚动的高度 delaytime = 100 //停留时间 scrollupRadio = 18 //每段显示中的文字向上滚动速度... stopscroll=false; icefable1.scrollTop=0; //设置层的属性 with(icefable1){ //宽度0 style.width=258; //高度为设定的滚动高度 style.height=marqueesHeight; //溢出不显示.. style.overflowX="visible"; style.overflowY="hidden"; //不允许换行.. noWrap= false //true; onmouseover=new Function("stopscroll=true"); onmouseout=new Function("stopscroll=false"); } //将层中的数据输出两次,由于限制了高度,所以不会显示出来; icefable1.innerHTML+=icefable1.innerHTML+=icefable1.innerHTML+=icefable1.innerHTML+=icefable1.innerHTML+=icefable1.innerHTML; function init_srolltext(){ icefable1.scrollTop= 0; setInterval("scrollUp()",scrollupRadio); //滚动速度...100 } init_srolltext(); // ?? ; 当前top ,停留时间 preTop=0; currentTop=0; stoptime=0; function scrollUp(){ if(stopscroll==true) return; currentTop+=1; if(currentTop==146) { stoptime+=1; currentTop-=1; if(stoptime==delaytime) { currentTop=0; stoptime=0; } } else { preTop=icefable1.scrollTop; icefable1.scrollTop+=1; if(preTop==icefable1.scrollTop){ icefable1.scrollTop=25 //189; icefable1.scrollTop+=1; } } } 〈/SCRIPT〉 〈/div〉 |
|
|
|
| 文章录入:qiwenjing 责任编辑:qiwenjing |
|
上一篇文章: 动易2006SP4止共103个模板,具体修改位置
下一篇文章: 分享友情链接滚动代码 |
| 【字体:小 大】【发表评论】【加入收藏】【告诉好友】【打印此文】【关闭窗口】 |