<script language='javascript'>
<!--
/********************************/
/* 文字自动循环滚动 */
/* IE6 FF1.0.4 */
/* 不支持xhtml声明的文档 */
/********************************/
//*********不要修改这部分***************
//scrollBodyId: String 内部滚动div的id
//scrollBoxId: String 外面限制div的id
//showHeight: Int 限制显示高度
//showWidth: Int 限制显示宽度
//lineHeight: Int 每行的高度
//stopTime: Int 间隔停止的时间(毫秒)
//speed: Int 滚动速度(毫秒,越小越快)
var ScrollObj = function(scrollBodyId,scrollBoxId,showHeight,showWidth,lineHeight,stopTime,speed) {
this.obj = document.getElementById(scrollBodyId);
this.box = document.getElementById(scrollBoxId);
this.style = this.obj.style;
this.defaultHeight = this.obj.offsetHeight;
this.obj.innerHTML += this.obj.innerHTML;
this.obj.style.position = "relative";
this.box.style.height = showHeight;
this.box.style.width = showWidth;
this.box.style.overflow = "hidden";
this.scrollUp = doScrollUp;
this.stopScroll = false;
this.curLineHeight =
文字自动循环滚动js函数
最新推荐文章于 2024-12-25 16:40:48 发布

这篇博客介绍了如何使用JavaScript实现文字自动循环滚动和左右滚动的效果。通过创建 ScrollObj 函数来处理文字滚动,设置不同参数如滚动速度、停止时间和显示高度。同时,还展示了如何实现图片的左右滚动效果,利用定时器和鼠标悬停事件控制滚动的启停。
最低0.47元/天 解锁文章
246

被折叠的 条评论
为什么被折叠?



