大家好,又见面了,我是你们的朋友全栈君。
向上:
<
div
id
=demo
style
=”overflow:hidden; width:128px; height:300px;”
>
<
div
id
=demo1
>
<
img
src
=”/529blog/gfjs.gif”
><
br
><
img
src
=”/529blog/bxtt.gif”
><
br
><
img
src
=”/529blog/bzjd.gif”
><
br
>
<
img
src
=”/529blog/gfjs.gif”
><
br
><
img
src
=”/529blog/bxtt.gif”
><
br
><
img
src
=”/529blog/bzjd.gif”
><
br
>
<
img
src
=”/529blog/gfjs.gif”
><
br
><
img
src
=”/529blog/bxtt.gif”
><
br
><
img
src
=”/529blog/bzjd.gif”
><
br
>
<
img
src
=”/529blog/gfjs.gif”
><
br
><
img
src
=”/529blog/bxtt.gif”
><
br
><
img
src
=”/529blog/bzjd.gif”
><
br
>
<
img
src
=”/529blog/gfjs.gif”
><
br
><
img
src
=”/529blog/bxtt.gif”
><
br
><
img
src
=”/529blog/bzjd.gif”
><
br
>
<
img
src
=”/529blog/gfjs.gif”
><
br
><
img
src
=”/529blog/bxtt.gif”
><
br
><
img
src
=”/529blog/bzjd.gif”
><
br
>
<
img
src
=”/529blog/gfjs.gif”
><
br
><
img
src
=”/529blog/bxtt.gif”
><
br
><
img
src
=”/529blog/bzjd.gif”
><
br
>
<
img
src
=”/529blog/gfjs.gif”
><
br
><
img
src
=”/529blog/bxtt.gif”
><
br
><
img
src
=”/529blog/bzjd.gif”
><
br
>
<
img
src
=”/529blog/gfjs.gif”
><
br
><
img
src
=”/529blog/bxtt.gif”
><
br
><
img
src
=”/529blog/bzjd.gif”
><
br
>
<
img
src
=”/529blog/gfjs.gif”
><
br
><
img
src
=”/529blog/bxtt.gif”
><
br
><
img
src
=”/529blog/bzjd.gif”
><
br
>
<
img
src
=”/529blog/gfjs.gif”
><
br
><
img
src
=”/529blog/bxtt.gif”
><
br
><
img
src
=”/529blog/bzjd.gif”
><
br
>
</
div
>
<
div
id
=demo2
></
div
>
</
div
>
<
script
language
=”javascript”
>
var speed=30
demo2.innerHTML=demo1.innerHTML
function Marquee(){
if(demo2.offsetTop–demo.scrollTop<=0)
demo.scrollTop-=demo1.offsetHeight
else{
demo.scrollTop++
}
}
var MyMar=setInterval(Marquee,speed)
demo.onmouseover=function() {clearInterval(MyMar)}
demo.onmouseout=function() {MyMar=setInterval(Marquee,speed)}
</
script
>
向下:
<
div
id
=demo
style
=”overflow:hidden; width:128px; height:300px;”
>
<
div
id
=demo1
>
<
img
src
=”/529blog/gfjs.gif”
><
br
><
img
src
=”/529blog/bxtt.gif”
><
br
><
img
src
=”/529blog/bzjd.gif”
><
br
>
<
img
src
=”/529blog/gfjs.gif”
><
br
><
img
src
=”/529blog/bxtt.gif”
><
br
><
img
src
=”/529blog/bzjd.gif”
><
br
>
<
img
src
=”/529blog/gfjs.gif”
><
br
><
img
src
=”/529blog/bxtt.gif”
><
br
><
img
src
=”/529blog/bzjd.gif”
><
br
>
<
img
src
=”/529blog/gfjs.gif”
><
br
><
img
src
=”/529blog/bxtt.gif”
><
br
><
img
src
=”/529blog/bzjd.gif”
><
br
>
<
img
src
=”/529blog/gfjs.gif”
><
br
><
img
src
=”/529blog/bxtt.gif”
><
br
><
img
src
=”/529blog/bzjd.gif”
><
br
>
<
img
src
=”/529blog/gfjs.gif”
><
br
><
img
src
=”/529blog/bxtt.gif”
><
br
><
img
src
=”/529blog/bzjd.gif”
><
br
>
<
img
src
=”/529blog/gfjs.gif”
><
br
><
img
src
=”/529blog/bxtt.gif”
><
br
><
img
src
=”/529blog/bzjd.gif”
><
br
>
<
img
src
=”/529blog/gfjs.gif”
><
br
><
img
src
=”/529blog/bxtt.gif”
><
br
><
img
src
=”/529blog/bzjd.gif”
><
br
>
<
img
src
=”/529blog/gfjs.gif”
><
br
><
img
src
=”/529blog/bxtt.gif”
><
br
><
img
src
=”/529blog/bzjd.gif”
><
br
>
<
img
src
=”/529blog/gfjs.gif”
><
br
><
img
src
=”/529blog/bxtt.gif”
><
br
><
img
src
=”/529blog/bzjd.gif”
><
br
>
<
img
src
=”/529blog/gfjs.gif”
><
br
><
img
src
=”/529blog/bxtt.gif”
><
br
><
img
src
=”/529blog/bzjd.gif”
><
br
>
</
div
>
<
div
id
=demo2
></
div
>
</
div
>
<
script
language
=”javascript”
>
var speed=30
demo2.innerHTML=demo1.innerHTML
demo.scrollTop=demo.scrollHeight
function Marquee(){
if(demo1.offsetTop–demo.scrollTop>=0)
demo.scrollTop+=demo2.offsetHeight
else{
demo.scrollTop—
}
}
var MyMar=setInterval(Marquee,speed)
demo.onmouseover=function() {clearInterval(MyMar)}
demo.onmouseout=function() {MyMar=setInterval(Marquee,speed)}
</
script
>
向左:
<
div
id
=demo
style
=”overflow:hidden;height:100px;width:300px;”
><
table
align
=left
cellpadding
=0
cellspace
=0
border
=0
><
tr
><
td
id
=demo1
valign
=top
><
img
src
=”/529blog/gfjs.gif”
><
img
src
=”/529blog/bxtt.gif”
><
img
src
=”/529blog/bzjd.gif”
><
img
src
=”/529blog/gfjs.gif”
><
img
src
=”/529blog/bxtt.gif”
><
img
src
=”/529blog/bzjd.gif”
></
td
><
td
id
=demo2
valign
=top
></
td
></
tr
></
table
></
div
>
<
script
>
var speed=30
demo2.innerHTML=demo1.innerHTML
function Marquee(){
if(demo2.offsetWidth–demo.scrollLeft<=0)
demo.scrollLeft-=demo1.offsetWidth
else{
demo.scrollLeft++
}
}
var MyMar=setInterval(Marquee,speed)
demo.onmouseover=function() {clearInterval(MyMar)}
demo.onmouseout=function() {MyMar=setInterval(Marquee,speed)}
</
script
>
向右:
<
div
id
=demo
style
=”overflow:hidden;height:100px;width:300px;”
><
table
align
=left
cellpadding
=0
cellspace
=0
border
=0
><
tr
><
td
id
=demo1
valign
=top
><
img
src
=”/529blog/gfjs.gif”
><
img
src
=”/529blog/bxtt.gif”
><
img
src
=”/529blog/bzjd.gif”
><
img
src
=”/529blog/gfjs.gif”
><
img
src
=”/529blog/bxtt.gif”
><
img
src
=”/529blog/bzjd.gif”
></
td
><
td
id
=demo2
valign
=top
></
td
></
tr
></
table
></
div
>
<
script
>
var speed=30
demo2.innerHTML=demo1.innerHTML
demo.scrollLeft=demo.scrollWidth
function Marquee(){
if(demo.scrollLeft<=0)
demo.scrollLeft+=demo2.offsetWidth
else{
demo.scrollLeft—
}
}
var MyMar=setInterval(Marquee,speed)
demo.onmouseover=function() {clearInterval(MyMar)}
demo.onmouseout=function() {MyMar=setInterval(Marquee,speed)}
</
script
>
发布者:全栈程序员-用户IM,转载请注明出处:https://javaforall.cn/154829.html原文链接:https://javaforall.cn
【正版授权,激活自己账号】: Jetbrains全家桶Ide使用,1年售后保障,每天仅需1毛
【官方授权 正版激活】: 官方授权 正版激活 支持Jetbrains家族下所有IDE 使用个人JB账号...