版权声明
·
网站留言
·
联系我们
·
加入收藏
热门关键词:
焦点图
png图标
背景
按钮
首页
PNG图标
广告代码
网页模板
字体下载
JS代码
CSS样式
技术文档
网站常用
gif图片
JPG图片
JavaScript用户手册
flash动画
jsp编程
.net编程
网站配色
网站优化
Oracle教程
JS技术
数据库编程
网络维护
html基础
安全相关
测试相关
知识扩展
CSS技术
DIV+CSS实例
DIV+CSS教程
鼠标特效
网站常用
文字特效
时间日期
图片特效
表格图层
导航菜单
网页特效
详细内容
首页
>>
JS
>>
网站常用
>> 正文
[
关闭窗口
]
一行文字自动向上滚动代码
发布日期:2010-08-26
点击:7894
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN"> <HTML><HEAD> <META http-equiv=Content-Type content="text/html; charset=gb2312"> <STYLE>TD { FONT-SIZE: 12px } </STYLE> <STYLE type=text/css>BODY { FONT-SIZE: 12px; BACKGROUND-COLOR: transparent } A { COLOR: #5a5a5a; TEXT-DECORATION: none } A:hover { COLOR: #ff6600; TEXT-DECORATION: underline } </STYLE> </HEAD> <BODY> <SCRIPT> var scrollerwidth=220; var scrollerheight=17; var scrollerbgcolor=''; var pausebetweenimages=2000; var slideimages=new Array(); slideimages[0]='<a href="http://www.zdbase.com/" target="_blank">站点基地-网站素材</a>'; slideimages[1]='<a href="http://www.zdbase.com/" target="_blank">【投票】:原创漫画排行榜 </a>'; slideimages[2]='<a href="http://www.zdbase.com/" target="_blank">09 CJ Cosplay全国各赛区全面打响</a>'; if (slideimages.length>1) i=1 else i=0 function move1(whichlayer){ tlayer=eval(whichlayer) if (tlayer.top>0&&tlayer.top<=4){ tlayer.top=0 setTimeout("move1(tlayer)",pausebetweenimages) setTimeout("move2(document.main.document.second)",pausebetweenimages) return } if (tlayer.top>=tlayer.document.height*-1){ tlayer.top-=4 setTimeout("move1(tlayer)",100) } else{ tlayer.top=scrollerheight tlayer.document.write(slideimages[i]) tlayer.document.close() if (i==slideimages.length-1) i=0 else i++ } } function move2(whichlayer){ tlayer2=eval(whichlayer) if (tlayer2.top>0&&tlayer2.top<=4){ tlayer2.top=0 setTimeout("move2(tlayer2)",pausebetweenimages) setTimeout("move1(document.main.document.first)",pausebetweenimages) return } if (tlayer2.top>=tlayer2.document.height*-1){ tlayer2.top-=4 setTimeout("move2(tlayer2)",100) } else{ tlayer2.top=scrollerheight tlayer2.document.write(slideimages[i]) tlayer2.document.close() if (i==slideimages.length-1) i=0 else i++ } } function move3(whichdiv){ tdiv=eval(whichdiv) if (tdiv.style.pixelTop>0&&tdiv.style.pixelTop<=4){ tdiv.style.pixelTop=0 setTimeout("move3(tdiv)",pausebetweenimages) setTimeout("move4(second2)",pausebetweenimages) return } if (tdiv.style.pixelTop>=tdiv.offsetHeight*-1){ tdiv.style.pixelTop-=4 setTimeout("move3(tdiv)",100) } else{ tdiv.style.pixelTop=scrollerheight tdiv.innerHTML=slideimages[i] if (i==slideimages.length-1) i=0 else i++ } } function move4(whichdiv){ tdiv2=eval(whichdiv) if (tdiv2.style.pixelTop>0&&tdiv2.style.pixelTop<=4){ tdiv2.style.pixelTop=0 setTimeout("move4(tdiv2)",pausebetweenimages) setTimeout("move3(first2)",pausebetweenimages) return } if (tdiv2.style.pixelTop>=tdiv2.offsetHeight*-1){ tdiv2.style.pixelTop-=4 setTimeout("move4(second2)",100) } else{ tdiv2.style.pixelTop=scrollerheight tdiv2.innerHTML=slideimages[i] if (i==slideimages.length-1) i=0 else i++ } } function startscroll(){ if (document.all){ move3(first2) second2.style.top=scrollerheight } else if (document.layers){ move1(document.main.document.first) document.main.document.second.top=scrollerheight+5 document.main.document.second.visibility='show' } } window.onload=startscroll if (document.layers) document.write(slideimages[0]) if (document.layers) document.write(slideimages[1]) if (document.layers) document.write(slideimages[0]) if (document.all){ document.writeln('<span id="main2" style="position:relative;width:'+scrollerwidth+';height:'+scrollerheight+';overflow:hiden;background-color:'+scrollerbgcolor+'">') document.writeln('<div style="position:absolute;width:'+scrollerwidth+';height:'+scrollerheight+';clip:rect(0 '+scrollerwidth+' '+scrollerheight+' 0);left:0;top:0">') document.writeln('<div id="first2" style="position:absolute;width:'+scrollerwidth+';left:0;top:1;">') document.write(slideimages[0]) document.writeln('</div>') document.writeln('<div id="second2" style="position:absolute;width:'+scrollerwidth+';left:0;top:0">') document.write(slideimages[1]) document.writeln('</div>') document.writeln('</div>') document.writeln('</span>') } </SCRIPT> </BODY></HTML>
提示:您可以先修改部分代码再运行,复制代码和保存代码功能在Firefox下无效。
相关文章
鼠标悬停图标滚动一下效果原理
可以上下左右滚动的图片(兼容IE和火狐f...
随滚动条动态滑动的图片
一行文字自动向上滚动代码
CSS控制滚动条颜色
按住鼠标左键上下运动可以滚动页面
与以往不同的跟随鼠标的滚动文字
JS动态平滑滚动菜单效果
窗体不显示水平滚动条
页面滚动条控制
去除页面滚动条
用DIV控制滚动条
关于我们
-
版权声明
-
联系我们
-
网站留言
-
网站地图
Copyright © 2010 zdbase.com All Rights Reserved.
苏ICP备15039389号
可人软件设计