zoukankan
html css js c++ java
无间断滚动
Code
<
style type
=
"
text/css
"
>
<!--
#demo
{
background: #FFF;
overflow:hidden;
border: 1px dashed #CCC;
height: 100px;
text
-
align: center;
float
: left;
}
#demo img
{
border: 3px solid #F2F2F2;
display: block;
}
-->
</
style
>
向下滚动
<
div id
=
"
demo
"
>
<
div id
=
"
demo1
"
>
<
a href
=
"
#
"
><
img src
=
"
http://www.cnrui.cn/other/link/Clear_logo.gif
"
border
=
"
0
"
/></
a
>
<
a href
=
"
#
"
><
img src
=
"
http://www.cnrui.cn/other/link/Clear_logo.gif
"
border
=
"
0
"
/></
a
>
<
a href
=
"
#
"
><
img src
=
"
http://www.cnrui.cn/other/link/Clear_logo.gif
"
border
=
"
0
"
/></
a
>
<
a href
=
"
#
"
><
img src
=
"
http://www.cnrui.cn/other/link/Clear_logo.gif
"
border
=
"
0
"
/></
a
>
<
a href
=
"
#
"
><
img src
=
"
http://www.cnrui.cn/other/link/Clear_logo.gif
"
border
=
"
0
"
/></
a
>
</
div
>
<
div id
=
"
demo2
"
></
div
>
</
div
>
<
script
>
<!--
var speed
=
10
;
//
数字越大速度越慢
var tab
=
document.getElementById(
"
demo
"
);
var tab1
=
document.getElementById(
"
demo1
"
);
var tab2
=
document.getElementById(
"
demo2
"
);
tab2.innerHTML
=
tab1.innerHTML;
//
克隆demo1为demo2
tab.scrollTop
=
tab.scrollHeight
function Marquee()
{
if
(tab1.offsetTop
-
tab.scrollTop
>=
0
)
//
当滚动至demo1与demo2交界时
tab.scrollTop
+=
tab2.offsetHeight
//
demo跳到最顶端
else
{
tab.scrollTop
--
}
}
var MyMar
=
setInterval(Marquee,speed);
tab.onmouseover
=
function()
{clearInterval(MyMar)}
;
//
鼠标移上时清除定时器达到滚动停止的目的
tab.onmouseout
=
function()
{MyMar
=
setInterval(Marquee,speed)}
;
//
鼠标移开时重设定时器
-->
</
script
>
查看全文
相关阅读:
累加和校验算法(CheckSum算法)
云锵投资 2021 年 09 月简报
云锵投资 2021 年 08 月简报
断言与忽略断言
出现 undefined reference to `cv::String::deallocate()'的解决方法
about of string
esp32: A stack overflow in task spam_task has been detected.
IDEA部署Tomcat报错:No artifacts marked for deployment
在safari浏览器上使用php导出文件失败
laravel中使用vue热加载时 Cannot read property 'call' of undefined BUG解决方案
原文地址:https://www.cnblogs.com/wanglinglong/p/1557444.html
最新文章
(转)Python 标准库
(转)error: too few arguments to function ‘ngx_ssl_session_cache’
(转)Python 之 pip安装 及 使用详解
python-mysql/mysqlclient安装问题
python3 ipython自动补全和显示对象方法属性问题
win10搭建虚拟机——Hyper-V
Ubuntu 镜像文件下载
程序员行业有哪些越早知道越好的道理?
那些编程水平很高的程序员是怎么练成的?
Asp.Net MVC和webapi CSRF防攻击ajax使用方法
热门文章
动态类型dynamic(ExpandoObject)
asp.net mvc获取路由参数方法
Asp.Net MVC多表联合查询分页+多条件查询方法
Asp.net平台常用的框架整理[转载]
C#中异步编程Async和Await 的用法
超详细! Ubuntu 18.04 安装 NVIDIA 显卡驱动
为Ubuntu系统开启SSH服务,实现局域网内远程连接
linux挂载4T及以上硬盘 parted 工具
Angular项目去除URL中的#号
nz-zorro-mobile 5.0版本 ng build报错
Copyright © 2011-2022 走看看