zoukankan
html css js c++ java
[转]JS图片滚动效果
From:
http://bbs.blueidea.com/thread-2762084-1-1.html
演示效果:
http://bbs.blueidea.com/thread-2762084-1-1.html
<!
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=gb2312"
/>
<
title
>
家园网 www.wfamilies.com
</
title
>
<
style
type
="text/css"
>
*
{
}
{
margin
:
0
;
padding
:
0
;
}
body
{
}
{
background
:
#CCC
;
}
/**/
/*
--大块定义--
*/
#container
{
}
{
text-align
:
left
;
width
:
778px
;
overflow
:
hidden
;
background
:
#fff
;
}
#content
{
}
{
width
:
778px
;
}
/**/
/*
--休闲一刻--
*/
#xxyk
{
}
{
float
:
left
;
width
:
778px
;
margin
:
0
;
padding
:
0
;
background
:
#999
;
}
#xxyk .content
{
}
{
float
:
left
;
width
:
778px
;
margin
:
0
;
padding
:
0 0 20px 0
;
}
#xxyk .content img
{
}
{
border
:
0
;
}
#xxyk .content .roll
{
}
{
width
:
750px
;
margin
:
4px auto
;
padding
:
0 0 0 0
;
overflow
:
hidden
;
}
#xxyk .content .roll #main
{
}
{
list-style
:
none
;
width
:
1620px
;
padding
:
0
;
margin
:
0
;
}
#xxyk .content .roll #main #pic1,#xxyk .content .roll #main #pic2
{
}
{
float
:
left
;
text-align
:
left
;
width
:
810px
;
padding
:
0
;
margin
:
0
;
background
:
#f90
;
}
#xxyk .content .roll #main #pic1 a,#xxyk .content .roll #main #pic2 a
{
}
{
display
:
block
;
text-align
:
center
;
color
:
#FFFFFF
;
width
:
135px
;
}
#xxyk .content .roll #main #pic1 img,#xxyk .content .roll #main #pic2 img
{
}
{
display
:
block
;
clear
:
both
;
width
:
115px
;
height
:
111px
;
margin
:
0 auto 5px auto
;
padding
:
0
;
}
#xxyk .content .roll #main #pic1 ul,#xxyk .content .roll #main #pic2 ul
{
}
{
float
:
left
;
list-style
:
none
;
}
#xxyk .content .roll #main #pic1 ul li,#xxyk .content .roll #main #pic2 ul li
{
}
{
float
:
left
;
display
:
block
;
margin
:
0
;
padding
:
0
;
}
/**/
/*
--隐藏元素--
*/
#slhdly .title,#xxyk .content ul li.more
{
}
{
position
:
absolute
;
visibility
:
hidden
;
overflow
:
hidden
;
display
:
none
;
clip
:
rect(0,0,0,0)
;
height
:
0
;
}
</
style
>
</
head
>
<
body
>
<
div
id
="xxyk"
>
<
div
class
="content"
>
<
div
id
="pic"
class
="roll"
>
<
div
id
="main"
>
<
div
id
="pic1"
>
<
ul
>
<
li
><
a
href
="#"
target
=_blank
><
img
src
="http://www.blueidea.com/articleimg/game/cartoon/2007tshirt/2007-5-19/4044_s.jpg"
/
></
a
></
li
>
<
li
><
a
href
="#"
target
=_blank
><
img
src
="http://www.blueidea.com/articleimg/game/cartoon/2007tshirt/2007-5-19/4044_s.jpg"
/
></
a
></
li
>
<
li
><
a
href
="#"
target
=_blank
><
img
src
="http://www.blueidea.com/articleimg/game/cartoon/2007tshirt/2007-5-19/4044_s.jpg"
/
></
a
></
li
>
<
li
><
a
href
="#"
target
=_blank
><
img
src
="http://www.blueidea.com/articleimg/game/cartoon/2007tshirt/2007-5-19/4044_s.jpg"
/
></
a
></
li
>
<
li
><
a
href
="#"
target
=_blank
><
img
src
="http://www.blueidea.com/articleimg/game/cartoon/2007tshirt/2007-5-19/4044_s.jpg"
/
></
a
></
li
>
<
li
><
a
href
="#"
target
=_blank
><
img
src
="http://www.blueidea.com/articleimg/game/cartoon/2007tshirt/2007-5-19/4044_s.jpg"
/
></
a
></
li
>
</
ul
>
</
div
>
<
div
id
="pic2"
>
</
div
>
</
div
>
</
div
>
<
script
type
="text/javascript"
>
var
spe
=
22
;
/**/
/*
--控制移动速度--
*/
var
m
=
document.getElementById(
"
pic
"
);
var
m1
=
document.getElementById('pic1');
var
m2
=
document.getElementById('pic2');
m2.innerHTML
=
m1.innerHTML;
function
Marquee()
{
if
(m2.offsetWidth
-
m.scrollLeft
<=
0
)
{
m.scrollLeft
-=
m1.offsetWidth;
}
else
{
m.scrollLeft
++
;
}
}
var
k1;
function
startmarquee()
{
k1
=
setInterval(Marquee,spe)
}
window.setTimeout('startmarquee()',
1000
);
m.onmouseover
=
function
()
{clearInterval(k1)}
m.onmouseout
=
function
()
{k1
=
setInterval(Marquee,spe)}
</
script
>
</
div
>
</
div
>
</
body
>
</
html
>
查看全文
相关阅读:
supermall遇到的问题
github建立仓库
【Teradata】9794 ERRAMPOUTOFPHYSPACE error解决方法
MPP大规模并行计算数据库与分布式数据库的区别
【English】20190515
商业数据分析的四个层次
学会学习(Learning how to learn)
【English】20190513
【Teradata】DEL语句产生的锁
【Teradata】开启LockLogger与dumplocklog工具使用(含lokdisp工具说明)
原文地址:https://www.cnblogs.com/SummerRain/p/799431.html
最新文章
Win10走红背后,最开心的人却是谷歌
在Linux用户空间做内核空间做的事情
Linux 4.6分支已到生命尽头 请尽快升级至Linux 4.7.1
使用 Python 创建你自己的 Shell(下)
zabbix再爆高危SQL注入漏洞,可获系统权限
搭个 Web 服务器(一)
诠释Linux中『一切都是文件』概念和相应的文件类型
layui-dTree显示不出来且前台报错
mybatis-plus配置多数据源invalid bound statement (not found)
js报Uncaught SyntaxError: Unexpected token <错误 解决方法
热门文章
Navicat远程无法创建数据库
SpringBoot集成MybatisPlus报错
解决Eslint与格式化代码之间的矛盾
为什么使用了Element标签,样式却没有出来
水平垂直居中方法(包含flex新版本和旧版本)
Navicat如何运行SQL文件
码云(gitee)配置公钥 + 创建仓库
VUE中CSS去除Input的边框样式和阴影
vue中如何使用iconfont(阿里巴巴图标库)
解决Vue-cli3中的Eslint报错
Copyright © 2011-2022 走看看