marquee不间断图片
我想在DW中插入一个从右到左不间断的滚动图片,找到以下的一段代码,可是他是从下到上,我不知道从哪里进行修改,请大家帮忙解释并修改一下,麻烦了,谢谢<divid="demo...
我想在DW中插入一个从右到左不间断的滚动图片,找到以下的一段代码,可是他是从下到上,我不知道从哪里进行修改,请大家帮忙解释并修改一下,麻烦了,谢谢
<div id="demob" onmouseover="ij=1" style="border:1px solid gray;OVERFLOW: hidden; HEIGHT: 119px; width:211px " onmouseout="ij=0">
<div id="demob1">1<br>2<br>3<br>4<br>5<br>6<br>7<br>8<br>9<br>
可以是任何的HTML内容<br>
<font color="red">HTML</font><br>
</div>
<div id="demob2"></div>
</div>
<SCRIPT>
var ij=0;t=demob.scrollTop
demob2.innerHTML=demob1.innerHTML
function qswhMarquee2(){
if (ij==1)return
if(demob2.offsetTop-demob.scrollTop<=0)
demob.scrollTop-=demob1.offsetHeight
else
demob.scrollTop++
}
setInterval(qswhMarquee2,50)
</SCRIPT>
我按照下面这位仁兄的建议把里面的scrollTop该成scrollLeft
可是它就没有反应了,只显示内容在那里不动了,请问是哪里出了问题呢?
<div id="demob" onmouseover="ij=1" style="border:1px solid gray;OVERFLOW: hidden; HEIGHT: 119px; width:211px " onmouseout="ij=0">
<div id="demob1">1<br>2<br>3<br>4<br>5<br>6<br>7<br>8<br>9<br>
可以是任何的HTML内容<br>
<font color="red">HTML</font><br>
</div>
<div id="demob2"></div>
</div>
<SCRIPT>
var ij=0;t=demob.scrollLeft
demob2.innerHTML=demob1.innerHTML
function qswhMarquee2(){
if (ij==1)return
if(demob2.offsetTop-demob.scrollLeft<=0)
demob.scrollLeft-=demob1.offsetHeight
else
demob.scrollLeft++
}
setInterval(qswhMarquee2,50)
</SCRIPT> 展开
<div id="demob" onmouseover="ij=1" style="border:1px solid gray;OVERFLOW: hidden; HEIGHT: 119px; width:211px " onmouseout="ij=0">
<div id="demob1">1<br>2<br>3<br>4<br>5<br>6<br>7<br>8<br>9<br>
可以是任何的HTML内容<br>
<font color="red">HTML</font><br>
</div>
<div id="demob2"></div>
</div>
<SCRIPT>
var ij=0;t=demob.scrollTop
demob2.innerHTML=demob1.innerHTML
function qswhMarquee2(){
if (ij==1)return
if(demob2.offsetTop-demob.scrollTop<=0)
demob.scrollTop-=demob1.offsetHeight
else
demob.scrollTop++
}
setInterval(qswhMarquee2,50)
</SCRIPT>
我按照下面这位仁兄的建议把里面的scrollTop该成scrollLeft
可是它就没有反应了,只显示内容在那里不动了,请问是哪里出了问题呢?
<div id="demob" onmouseover="ij=1" style="border:1px solid gray;OVERFLOW: hidden; HEIGHT: 119px; width:211px " onmouseout="ij=0">
<div id="demob1">1<br>2<br>3<br>4<br>5<br>6<br>7<br>8<br>9<br>
可以是任何的HTML内容<br>
<font color="red">HTML</font><br>
</div>
<div id="demob2"></div>
</div>
<SCRIPT>
var ij=0;t=demob.scrollLeft
demob2.innerHTML=demob1.innerHTML
function qswhMarquee2(){
if (ij==1)return
if(demob2.offsetTop-demob.scrollLeft<=0)
demob.scrollLeft-=demob1.offsetHeight
else
demob.scrollLeft++
}
setInterval(qswhMarquee2,50)
</SCRIPT> 展开
展开全部
把里面的scrollTop该成scrollLeft
我把整段代码发上来:向左的
<div id=demo style=overflow:hidden;height:33;width:500;
background:#214984;color:#ffffff>
<table align=left cellpadding=0 cellspace=0 border=0>
<tr>
<td id=demo1 valign=top>
<img src="images/link/flashempire.gif">
<img src="images/linklogo/shlogo.gif">
<img src="images/link/deskcity.gif">
<img src="images/linklogo/5dmeng.gif">
<img src="http://flash9.net/Files/BeyondPic1/2005-10/27/logo.gif">
<img src="images/link/flashskylogo.gif">
<img src="images/link/5dlogo88.gif">
<img src="http://flash9.net/Files/BeyondPic1/2005-10/27/link.gif">
<img src="images/flash8.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:33;width:500;
background:#214984;color:#ffffff>
<table align=left cellpadding=0 cellspace=0 border=0>
<tr>
<td id=demo1 valign=top>
<img src="images/link/flashempire.gif">
<img src="images/linklogo/shlogo.gif">
<img src="images/link/deskcity.gif">
<img src="images/linklogo/5dmeng.gif">
<img src="http://flash9.net/Files/BeyondPic1/2005-10/27/logo.gif">
<img src="images/link/flashskylogo.gif">
<img src="images/link/5dlogo88.gif">
<img src="http://flash9.net/Files/BeyondPic1/2005-10/27/link.gif">
<img src="images/flash8.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>
我把整段代码发上来:向左的
<div id=demo style=overflow:hidden;height:33;width:500;
background:#214984;color:#ffffff>
<table align=left cellpadding=0 cellspace=0 border=0>
<tr>
<td id=demo1 valign=top>
<img src="images/link/flashempire.gif">
<img src="images/linklogo/shlogo.gif">
<img src="images/link/deskcity.gif">
<img src="images/linklogo/5dmeng.gif">
<img src="http://flash9.net/Files/BeyondPic1/2005-10/27/logo.gif">
<img src="images/link/flashskylogo.gif">
<img src="images/link/5dlogo88.gif">
<img src="http://flash9.net/Files/BeyondPic1/2005-10/27/link.gif">
<img src="images/flash8.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:33;width:500;
background:#214984;color:#ffffff>
<table align=left cellpadding=0 cellspace=0 border=0>
<tr>
<td id=demo1 valign=top>
<img src="images/link/flashempire.gif">
<img src="images/linklogo/shlogo.gif">
<img src="images/link/deskcity.gif">
<img src="images/linklogo/5dmeng.gif">
<img src="http://flash9.net/Files/BeyondPic1/2005-10/27/logo.gif">
<img src="images/link/flashskylogo.gif">
<img src="images/link/5dlogo88.gif">
<img src="http://flash9.net/Files/BeyondPic1/2005-10/27/link.gif">
<img src="images/flash8.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>
本回答被提问者采纳
已赞过
已踩过<
评论
收起
你对这个回答的评价是?
推荐律师服务:
若未解决您的问题,请您详细描述您的问题,通过百度律临进行免费专业咨询