Home > php教程 > php手册 > 无间隔纵向滚动公告栏

无间隔纵向滚动公告栏

WBOY
Release: 2016-06-21 09:11:58
Original
780 people have browsed it




您好!朋友

1.欢迎光临dev-club

2.进入php编程

3.进入joy asp

4.进入script

5.在dev-club您将获得最好的帮助




<script><br/>var _tv_moveSpeed = 50; // 速度控制,两次移动的间隔ms<br/>var _tv_movestep = 1; // 速度控制,每次的移动量px<br/>var _tv_post = 0; // 工作变量,当前偏移量<br/>var _tv_tvheight = 0; // 工作变量,移动区域的总高度<br/>var _tv_start = true; // 工作变量,运动状态控制<br/>/**<br/> * 移动控制<br/> * 首次调用需有参数<br/> */<br/>function tv_item_move(v) {<br/> if(v) { // 第一次进入<br/> _tv_item.innerHTML += _tv_item.innerHTML; // 复制移动区域内容,这是本算法的关键<br/> _tv_tvheight = _tv_item.offsetHeight; // 获取移动区域的总高度<br/> }<br/> if(_tv_start) { // 是移动状态<br/> _tv_post -= _tv_movestep; // 计算偏移<br/> if(_tv_post+_tv_tvheight < _tv_box.offsetHeight) // 若移动后将露出底部<br/> _tv_post += _tv_tvheight/2; // 将偏移上调一段<br/> _tv_item.style.pixelTop = _tv_post; // 设置偏移<br/> }<br/> setTimeout('tv_item_move()',_tv_moveSpeed); // 启动定时器<br/>}<br/>/*** 启动纵向滚动 ***/<br/>tv_item_move(1);<br/></script>



Related labels:
source:php.cn
Statement of this Website
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn
Popular Recommendations
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template