标题:求助:在同一页面有两个滚动效果,冲突出在那里?
只看楼主
whfweb
Rank: 1
等 级:新手上路
帖 子:3
专家分:0
注 册:2015-3-25
结帖率:100%
已结贴  问题点数:20 回复次数:5 
求助:在同一页面有两个滚动效果,冲突出在那里?
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
<HTML><HEAD><TITLE>不间断滚动</TITLE>
<META http-equiv=Content-Type content="text/html; charset=gb2312">
<META content="MSHTML 6.00.2900.2180" name=GENERATOR></HEAD>
<base href="http://www.

<BODY>


<CENTER>
<TABLE cellSpacing=0 cellPadding=0 width=700 border=0>
  <TBODY>
  <TR>
    <TD>
      <DIV id=demo style="OVERFLOW: hidden; WIDTH: 700px; COLOR: #ffffff; HEIGHT: 120px">
      <TABLE cellPadding=0 align=left border=0 cellspace="0">
        <TBODY>
        <TR>
          <TD id=demo1 vAlign=top>
            <TABLE cellSpacing=0 cellPadding=0 border=0>
              <TBODY>
              <TR>
                <TD><A href="#" target=_blank><IMG class=b5 height=100 hspace=22 src="jsimg/1.jpg" width=150></A><BR>
                  <CENTER><B>说明一</B></CENTER></TD>
                <TD width=30></TD>
                <TD><A href="#" target=_blank><IMG class=b5 height=100 hspace=22 src="jsimg/2.jpg" width=150></A><BR>
                  <CENTER><B>说明二</B></CENTER></TD></TD>
                <TD width=30></TD>
                <TD><A href="#" target=_blank><IMG class=b5 height=100 hspace=22 src="jsimg/3.jpg" width=150></A><BR>
                  <CENTER><B>说明三</B></CENTER></TD>
                <TD><A href="#" target=_blank><IMG class=b5 height=100 hspace=22 src="jsimg/4.jpg" width=150></A><BR>
                  <CENTER><B>说明四</B></CENTER></TD>
                <TD width=30></TD>
                <TD><A href="#" target=_blank><IMG class=b5 height=100 hspace=22 src="jsimg/5.jpg" width=150></A><BR>
                  <CENTER><B>说明五</B></CENTER></TD></TR></TBODY></TABLE></TD>
          <TD id=demo2 vAlign=top></TD></TR></TBODY></TABLE></DIV>

<SCRIPT>
var speed=10//速度数值越大速度越慢
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>


</TD></TR></TBODY></TABLE></CENTER>



<CENTER>
<TABLE cellSpacing=0 cellPadding=0 width=700 border=0>
  <TBODY>
  <TR>
    <TD>
      <DIV id=dom1 style="OVERFLOW: hidden; WIDTH: 700px; COLOR: #ffffff; HEIGHT: 120px">
      <TABLE cellPadding=0 align=left border=0 cellspace="0">
        <TBODY>
        <TR>
          <TD id=dom11 vAlign=top>
            <TABLE cellSpacing=0 cellPadding=0 border=0>
              <TBODY>
              <TR>
                <TD><A href="#" target=_blank><IMG class=b5 height=100 hspace=22 src="jsimg/1.jpg" width=150></A><BR>
                  <CENTER><B>说明一</B></CENTER></TD>
                <TD width=30></TD>
                <TD><A href="#" target=_blank><IMG class=b5 height=100 hspace=22 src="jsimg/2.jpg" width=150></A><BR>
                  <CENTER><B>说明二</B></CENTER></TD></TD>
                <TD width=30></TD>
                <TD><A href="#" target=_blank><IMG class=b5 height=100 hspace=22 src="jsimg/3.jpg" width=150></A><BR>
                  <CENTER><B>说明三</B></CENTER></TD>
                <TD><A href="#" target=_blank><IMG class=b5 height=100 hspace=22 src="jsimg/4.jpg" width=150></A><BR>
                  <CENTER><B>说明四</B></CENTER></TD>
                <TD width=30></TD>
                <TD><A href="#" target=_blank><IMG class=b5 height=100 hspace=22 src="jsimg/5.jpg" width=150></A><BR>
                  <CENTER><B>说明五</B></CENTER></TD></TR></TBODY></TABLE></TD>
          <TD id=dom12 vAlign=top></TD></TR></TBODY></TABLE></DIV>

<SCRIPT>
var speed=10//速度数值越大速度越慢
dom12.innerHTML=dom11.innerHTML
function Marquee(){
  if(dom12.offsetWidth-dom1.scrollLeft<=0)
  dom1.scrollLeft-=dom11.offsetWidth
  else{
  dom1.scrollLeft++
  }
}
var MyMar=setInterval(Marquee,speed)
dom1.onmouseover=function() {clearInterval(MyMar)}
dom1.onmouseout=function() {MyMar=setInterval(Marquee,speed)}
</SCRIPT>


</TD></TR></TBODY></TABLE></CENTER>


</BODY></HTML>
搜索更多相关主题的帖子: content PUBLIC ffffff border hidden 
2015-03-25 20:03
冰镇柠檬汁儿
Rank: 16Rank: 16Rank: 16Rank: 16
来 自:北京
等 级:版主
威 望:120
帖 子:8074
专家分:6657
注 册:2005-11-7
得分:0 
冲突在于完全相同的代码你写了两遍

本来无一物,何处惹尘埃
It is empty at all here, Why pm 2.5 is so TMD high!
2015-03-25 21:24
whfweb
Rank: 1
等 级:新手上路
帖 子:3
专家分:0
注 册:2015-3-25
得分:0 
回复 2楼 冰镇柠檬汁儿
代码是有差别的,问题是一个鼠标指上去能停,一个不能停.
2015-03-25 21:37
冰镇柠檬汁儿
Rank: 16Rank: 16Rank: 16Rank: 16
来 自:北京
等 级:版主
威 望:120
帖 子:8074
专家分:6657
注 册:2005-11-7
得分:20 
拜托,大哥,speed变量、Marquee函数和MyMar变量被重定义了两遍,并都赋值了,后者覆盖前者,你告诉我Marquee函数里面的变量不一样有毛用啊,第一次声明的Marquee函数已经没有了,拜托。
麻烦您抬抬手,修改一下变量名和函数名好吗,这么让人吐槽的陋习,您就不能改改?

不说了,槽点太多……

本来无一物,何处惹尘埃
It is empty at all here, Why pm 2.5 is so TMD high!
2015-03-25 23:55
whfweb
Rank: 1
等 级:新手上路
帖 子:3
专家分:0
注 册:2015-3-25
得分:0 
回复 4楼 冰镇柠檬汁儿
搞好了,谢谢兄弟~
2015-03-26 11:39
冰镇柠檬汁儿
Rank: 16Rank: 16Rank: 16Rank: 16
来 自:北京
等 级:版主
威 望:120
帖 子:8074
专家分:6657
注 册:2005-11-7
得分:0 
谁是你兄弟,叫姐姐

本来无一物,何处惹尘埃
It is empty at all here, Why pm 2.5 is so TMD high!
2015-03-26 23:01



参与讨论请移步原网站贴子:https://bbs.bccn.net/thread-443093-1-1.html




关于我们 | 广告合作 | 编程中国 | 清除Cookies | TOP | 手机版

编程中国 版权所有,并保留所有权利。
Powered by Discuz, Processed in 0.022077 second(s), 7 queries.
Copyright©2004-2024, BCCN.NET, All Rights Reserved