当前位置: 首页 > 图文教程 > 网络编程 > Javascript > js文字滚动停顿效果代码

Javascript
纯JS半透明Tip效果代码
JavaScript 读URL参数增强改进版版
JS对URL字符串进行编码/解码分析
javescript完整操作Table的增加行,删除行的列子大全
js可填可选的下拉框
prototype Element学习笔记(篇一)
prototype Element学习笔记(篇二)
prototype Element学习笔记(Element篇三)
Prototype使用指南之selector.js说明
不唐突的JavaScript的七条准则整理收集
js判断变量是否空值的代码
Firefox getBoxObjectFor getBoundingClientRect联系
Div自动滚动到末尾的代码
javascript笔试题目附答案
javascript引导程序
js身份证验证超强脚本
JS给元素注册事件的代码
JavaScript函数、方法、对象代码
JS写的数字拼图小游戏代码[学习参考]
关于B/S判断浏览器断开的问题讨论

Javascript 中的 js文字滚动停顿效果代码


出处:互联网   整理: 软晨网(RuanChen.com)   发布: 2009-09-12   浏览: 572 ::
收藏到网摘: n/a

javascript文字滚动停顿效果的实现代码 <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>间断滚动_www.ruanchen.com_软晨学习网</title>
<style>
#Marquee{ height:60px; overflow:hidden;}
#Marquee div{ border:1px solid #DDD3FE; background:#EEECF4; height:58px;}
</style>
</head>
<body>
<div id="Marquee">
<div style="width: 160px; height: 58px">间断-1-caiying2007</div>
<div style="width: 160px; height: 58px">间断-2-caiying2007</div>
<div style="width: 160px; height: 58px">间断-3-caiying2007</div>
</div>
<script>
var Mar = document.getElementById("Marquee");
var child_div=Mar.getElementsByTagName("div")
var picH = 60;//移动高度
var scrollstep=3;//移动步幅,越大越快
var scrolltime=20;//移动频度(毫秒)越大越慢
var stoptime=3000;//间断时间(毫秒)
var tmpH = 0;
Mar.innerHTML += Mar.innerHTML;
function start(){
if(tmpH < picH){
tmpH += scrollstep;
if(tmpH > picH )tmpH = picH ;
Mar.scrollTop = tmpH;
setTimeout(start,scrolltime);
}else{
tmpH = 0;
Mar.appendChild(child_div[0]);
Mar.scrollTop = 0;
setTimeout(start,stoptime);
}
}
onload=function(){setTimeout(start,stoptime)};
</script></body>
</html>