| 网站首页 | 业界新闻 | 小组 | 威客 | 人才 | 下载频道 | 博客 | 代码贴 | 在线编程 | 编程论坛
欢迎加入我们,一同切磋技术
用户名:   
 
密 码:  
共有 367 人关注过本帖
标题:我的滚动效果的js代码页面提示报错
只看楼主 加入收藏
foreven11
Rank: 1
等 级:新手上路
帖 子:2
专家分:0
注 册:2011-6-20
收藏
 问题点数:0 回复次数:0 
我的滚动效果的js代码页面提示报错
这个页面有两段js滚动代码,一段是图片往上滚动效果,一段是往右滚动效果,页面提示网页错误:行231 字符3 错误:缺少对象  代码  o

<!--#include file="Inc/SysProduct.asp" -->
<%
function cutstr(tempstr,tempwid)
if len(tempstr)>tempwid then
cutstr=left(tempstr,tempwid)&"..."
else
cutstr=tempstr
end if
end function%>
<!-- #include file="Head.asp" -->
<style>
.menurbot{
    background-image:url(Images/menur_bottom.jpg);
    width:220px;
    height:12px;}
  
</style>
    <table height="172" cellspacing="2" cellpadding="0" width="990" align="center"
bgcolor="#ffffff" border="0">
  <tbody>
    <tr>
      <td valign="top" width="209"><table height="170" cellspacing="0" cellpadding="0" width="220" border="0">
        <tbody>
          <tr>
            <td><table height="101" cellspacing="0" cellpadding="0" width="220" border="0">
                <tbody>
                  <tr>
                    <td width="220" height="34" valign="middle" background="imgbeq/menur_title.jpg"  ><div align="center" style="font-family: &quot;宋体&quot;; font-size: 14px; color: #FFFFFF; font-weight: bold">产品中心</div></td>
                  </tr>
                  <tr>
                    <td position:relative;  border:solid #ccc; height="64" style="padding-top:8px;" background=images/menur_bg.jpg><% call ShowSmallClass_Tree() %></td>
                  </tr>
                </tbody>
            </table></td>
          </tr>
          <tr>
            <td valign="top"  width="209"><table height="179" background=images/menur_bg.jpg cellspacing="0" cellpadding="0" width="220" border="0">
                <tbody>
                  <tr>
                    <td width="220" height="34" valign="middle" background="imgbeq/menur_title.jpg"  ><div align="center" style="color: #FFFFFF; font-weight: bold; font-family: &quot;宋体&quot;; font-size: 14px">联系我们</div></td>
                  </tr>
                  <tr>
                    <td height="145" style="padding-top:8px;" position:relative;  border:solid #ccc; ><%
Set rsmenu = Server.CreateObject("ADODB.Recordset")
sql="select Content from culture where Title='left'"
rsmenu.open sql,conn,1,3
%>
                        <%=rsmenu("Content")%>
                        <%rsmenu.close
set rsmenu=nothing
%>
                        <br />
                        <div class="two_space">
                          <ul>
                           
                              <div align="center"><a href="http://sighttp. target=_blank; onClick="var tempSrc='http://sighttp.'+Math.random()+'&sigkey=80da4b8ca3e9e2ecb774fa9130ed50ac2a71d3637cb6db04633af4da2a59eba5';var oldscript=document.getElementById('testJs');var newscript=document.createElement('script');newscript.setAttribute('type','text/javascript'); newscript.setAttribute('id', 'testJs');newscript.setAttribute('src',tempSrc);if(oldscript == null){document.body.appendChild(newscript);}else{oldscript.parentNode.replaceChild(newscript, oldscript);}return false;"><img src='http://wpa.' alt="453919879" border="0" align="middle" /></a></div>
                           
                           
                              <div align="center"><a href="http://sighttp. target=_blank; onClick="var tempSrc='http://sighttp.'+Math.random()+'&sigkey=6aed1916c59eb22387f5d0d7003300c576d5edabfc5e92e21912963d2c519f8f';var oldscript=document.getElementById('testJs');var newscript=document.createElement('script');newscript.setAttribute('type','text/javascript'); newscript.setAttribute('id', 'testJs');newscript.setAttribute('src',tempSrc);if(oldscript == null){document.body.appendChild(newscript);}else{oldscript.parentNode.replaceChild(newscript, oldscript);}return false;"><img src='http://wpa.' alt="625831803" border="0" align="middle" /></a></div>
                           
                          </ul>
                        </div><div class="menurbot"><br/></div>
    </td>
                  </tr>
                </tbody>
            </table></td>
          </tr>
        </tbody>
      </table>
      
      <td valign="top" align="middle" width="781"><table cellspacing="0" cellpadding="0" width="100%" border="0">
            <tbody>
              <tr>
                <td valign="top" align="left">&nbsp;</td>
                <td valign="top" align="left"><table cellspacing="0" cellpadding="0" width="100%" border="0">
                    <tbody>
                      <tr>
                        <td valign="top" align="left" background="" height="233"><table height="236" cellspacing="0" cellpadding="0" width="725"
                  border="0">
                            <tbody>
                              <tr>
                                <td height="27"  valign="middle" ><table width="750" height="25" border="0" align="center" cellpadding="0" cellspacing="0"  background="images/channel_title.jpg">
                                    <tbody>
                                      <tr>
                                        <td width="652" height="25"><span style="font-size: 14px; font-weight: bold">&nbsp;&nbsp;推荐产品</span></td>
                                        <td width="28"><a
                              href="Product.asp">更多</a></td>
                                      </tr>
                                    </tbody>
                                </table></td>
                              </tr>
                              <tr>
                                <td><table style="MARGIN-TOP: 8px" cellspacing="0"
                        cellpadding="0" width="100%" border="0">
                                    <tbody>
                                      <tr align="middle">
                                        <td width="728" background="">
<style type="text/css">
  body{
      margin:0px;
      padding:0px;
     }
 *{margin:0px; padding:0px;}
 *{font-size:12px;}
 #scroll{width:700px; height:170px;  overflow:hidden; border:0px #FF0000 solid  }/*line-height是每次移动的距离,overflow;hidden 也不能省*/
 #scroll li{   width:700px; float:left; height:170px; text-align:center;}
 #scroll ul{ list-style:none; width:300px}
#scroll li img{width:165px; height:140px; border:none; padding:3px; border:#CCC 1px solid;}
 #scroll li p{font-size:12px; text-align:center; line-height:30px;}
 
</style>
<script type="text/javascript">
function Marquee(){
  this.ID=document.getElementById(arguments[0]);
  this.Direction=arguments[1];
  this.Step=arguments[2];
  this.Width=arguments[3];
  this.Height=arguments[4];
  this.Timer=arguments[5];
  this.WaitTime=arguments[6];
  this.StopTime=arguments[7];
  if(arguments[8]){this.ScrollStep=arguments[8];}else{this.ScrollStep=this.Direction>1?this.Width:this.Height;}
  this.CTL=this.StartID=this.Stop=this.MouseOver=0;
  this.ID.style.overflowX=this.ID.style.overflowY="hidden";
  this.ID.noWrap=true;
  this.ID.style.width=this.Width;
  this.ID.style.height=this.Height;
  this.ClientScroll=this.Direction>1?this.ID.scrollWidth:this.ID.scrollHeight;
  this.ID.innerHTML+=this.ID.innerHTML;
  this.Start(this,this.Timer,this.WaitTime,this.StopTime);
  }
Marquee.prototype.Start=function(msobj,timer,waittime,stoptime){
  msobj.StartID=function(){msobj.Scroll();}
  msobj.Continue=function(){
    if(msobj.MouseOver==1){setTimeout(msobj.Continue,waittime);}
    else{clearInterval(msobj.TimerID); msobj.CTL=msobj.Stop=0; msobj.TimerID=setInterval(msobj.StartID,timer);}
    }
  msobj.Pause=function(){msobj.Stop=1; clearInterval(msobj.TimerID); setTimeout(msobj.Continue,waittime);}
  msobj.Begin=function(){
    msobj.TimerID=setInterval(msobj.StartID,timer);
    msobj.ID.onmouseover=function(){msobj.MouseOver=1; clearInterval(msobj.TimerID);}
    msobj.ID.onmouseout=function(){msobj.MouseOver=0; if(msobj.Stop==0){clearInterval(msobj.TimerID); msobj.TimerID=setInterval(msobj.StartID,timer);}}
    }
  setTimeout(msobj.Begin,stoptime);
  }
Marquee.prototype.Scroll=function(){
  switch(this.Direction){
    case 0:
      this.CTL+=this.Step;
      if(this.CTL>=this.ScrollStep&&this.WaitTime>0){this.ID.scrollTop+=this.ScrollStep+this.Step-this.CTL; this.Pause(); return;}
      else{if(this.ID.scrollTop>=this.ClientScroll) this.ID.scrollTop-=this.ClientScroll; this.ID.scrollTop+=this.Step;}
      break;
    case 1:
      this.CTL+=this.Step;
      if(this.CTL>=this.ScrollStep&&this.WaitTime>0){this.ID.scrollTop-=this.ScrollStep+this.Step-this.CTL; this.Pause(); return;}
      else{if(this.ID.scrollTop<=0) this.ID.scrollTop+=this.ClientScroll; this.ID.scrollTop-=this.Step;}
      break;
    case 2:
      this.CTL+=this.Step;
      if(this.CTL>=this.ScrollStep&&this.WaitTime>0){this.ID.scrollLeft+=this.ScrollStep+this.Step-this.CTL; this.Pause(); return;}
      else{if(this.ID.scrollLeft>=this.ClientScroll) this.ID.scrollLeft-=this.ClientScroll; this.ID.scrollLeft+=this.Step;}
      break;
    case 3:
      this.CTL+=this.Step;
      if(this.CTL>=this.ScrollStep&&this.WaitTime>0){this.ID.scrollLeft-=this.ScrollStep+this.Step-this.CTL; this.Pause(); return;}
      else{if(this.ID.scrollLeft<=0) this.ID.scrollLeft+=this.ClientScroll; this.ID.scrollLeft-=this.Step;}
      break;
    }
  }
</script>
<div id="scroll">
<!--------------------显示最新产品的子程序开始--------------------->
                            <table width="100%" border="0" align="center" cellpadding="0" cellspacing="0">
                              <%
set rs_Product=server.createobject("adodb.recordset")
sqltext="select top " & Product_count & " * from Product where Passed=True and Elite=true  order by UpdateTime desc"
rs_Product.open sqltext,conn,1,1
%>
                              <tr align="center">
                                <%
           If rs_Product.eof and rs_Product.bof then
           response.write "<td><p align='center'><font color='#ff0000'>还没任何产品</font></p></td>"
           else
              row_count=1
              Do While Not rs_Product.EOF%>
                                <td><table width="1%"  border="0" cellspacing="0" cellpadding="0">
                                  <tr>
                                    <td><table width="100%"  border="0" cellpadding="3" cellspacing="1" bgcolor="#E9E9E9">
                                        <tr>
                                          <td width="130" bgcolor="#FFFFFF"><table width="130"  border="0" cellpadding="0" cellspacing="0" bgcolor="#E9E9E9">
                                              <tr>
                                                <td width="130" height="110" align="center" valign="middle" bgcolor="#FFFFFF"><a href="ProductShow.asp?ID=<%=rs_Product("id")%>"><img src=<%=rs_Product("DefaultPicUrl")%> width="170" height="140" border=0 ></a></td>
                                              </tr>
                                          </table></td>
                                        </tr>
                                    </table></td>
                                    <td valign="top"><img src="Img/yyri2.gif" width="7" height="112" /></td>
                                  </tr>
                                  <tr>
                                    <td colspan="2"><table width="100%"  border="0" cellspacing="2" cellpadding="0">
                                        <tr>
                                          <td height="30" align="center"><a href="ProductShow.asp?ID=<%=rs_Product("id")%>"><%=rs_Product("Title")%></a></td>
                                        </tr>
                                    </table></td>
                                  </tr>
                                </table></td>
                                <% if row_count mod 8 =0 then%>
                              </tr>
                              <tr>
                                <%end if%>
                                <%
rs_Product.MoveNext
row_count=row_count+1
Loop
end if
rs_Product.close
%>
                              </tr>
                          </table><!--------------------显示最新产品的子程序结束--------------------->
</div>
<script>
window.onload=function(){
  new Marquee(
    "scroll",  //容器ID<br />
    0,  //向上滚动(0向上 1向下 2向左 3向右)<br />
    2,  //滚动的步长<br />
    700,  //容器可视宽度<br />
    170,  //容器可视高度<br />
    50,  //定时器 数值越小,滚动的速度越快(1000=1秒,建议不小于20)<br />
    1000,  //间歇停顿时间(0为不停顿,1000=1秒)<br />
    1000,  //开始时的等待时间(0为不等待,1000=1秒)<br />
   170//间歇滚动间距(可选)<br />
    );
  };
</script>

                                       
                                      </td>
                                      </tr>
                                    </tbody>
                                </table></td>
                              </tr>
                            </tbody>
                        </table></td>
                        <td valign="top" align="left" width="9"
              background="">&nbsp;</td>
                      </tr>
                    </tbody>
                </table></td>
              </tr>
            </tbody>
          </table>
        <table width="752" border="0" >
            <tbody>
              <tr>
                                <td height="27"  valign="middle" ><table width="750" height="25" border="0" align="center" cellpadding="0" cellspacing="0"  background="images/channel_title.jpg">
                                    <tbody>
                                      <tr>
                                        <td width="78" height="25"><span style="font-size: 14px; font-weight: bold">&nbsp;&nbsp;合作伙伴</span></td>
                                        <td width="640">&nbsp;</td>
                                        <td width="32"><a
                              href="CompVisualize.asp">更多</a></td>
                                      </tr>
                                    </tbody>
                                </table></td>
                              </tr>
              <tr>
                <td>
               
                <style type="text/css">
<!--

#demo {
    MARGIN: auto; OVERFLOW: hidden; WIDTH: 700px;  TEXT-ALIGN: center
}
-->
</style>
<DIV id=demo>
        <TABLE height=110 cellSpacing=0 cellPadding=0 align=left border=0
            cellspace="0">
          <TBODY>
            <TR>
              <TD id=demo1 vAlign=top><!--滚动区的高度和宽度-->
                    <TABLE width=170 height="100"
                  border=0 align=center cellPadding=0 cellSpacing=0 cellspace="0">
                      <TBODY>
                        <TR>
                          <TD id=demo1 vAlign=top>
                          
<span id="tb_A101">
              <table width="98%" height="45" border="0" align="center" cellspacing="5">
                    <tbody>
                                                    <%
set rs_Product=server.createobject("adodb.recordset")
sqltext="select top 4 * from CompVisualize order by id desc"
rs_Product.open sqltext,conn,1,1
%>

                      <tr>
                     
                                  <%
           If rs_Product.eof and rs_Product.bof then
           response.write "<td><p align='center'><font color='#ff0000'>还没任何案例</font></p></td>"
           else
              row_count=1
              Do While Not rs_Product.EOF%>
                        <td width="163" align="middle"><table cellspacing="0" cellpadding="0" width="130" align="center"
                  border="0">
                            <tbody>
                              <tr>
                                <td><a href="CompVisualizeBig.asp?ID=<%=rs_Product("id")%>"><img src=<%=rs_Product("CompVisualize")%> width="150" height="100" border=0 /></a></td>
                              </tr>
                              <tr>
                                <td valign="center" align="middle"
                      background="imgbeq/caseBottom02.gif"
                        height="22"><a href="CompVisualizeBig.asp?ID=<%=rs_Product("id")%>"><font
                  color="#ffffff"><%=rs_Product("explain")%></font></a></td>
                              </tr>
                            </tbody>
                        </table></td>
                                  <% if row_count mod 4 =0 then%>
                      </tr>
                                <tr>
                                  <%end if%>
                                  <%
rs_Product.MoveNext
row_count=row_count+1
Loop
end if
rs_Product.close
%>
                                </tr>
                    </tbody>
                </table></td>
              </tr>
            </tbody>
        </table>
              </TD>
                          <TD id=demo2 vAlign=top width=2></TD>
                        </TR>
                      </TBODY>
                  </TABLE>
                <!--最新图文代码结束--></TD>
              <TD id=demo2 vAlign=top></TD>
            </TR>
          </TBODY>
        </TABLE>
      
<script language="JavaScript" type="text/javascript">
// JavaScript Document

var speed=20;
document.getElementById("demo2").innerHTML=document.getElementById("demo1").innerHTML
function Marquee1(){
if(document.getElementById("demo2").offsetWidth-document.getElementById("demo").scrollLeft<=0)
document.getElementById("demo").scrollLeft-=document.getElementById("demo1").offsetWidth
else{
document.getElementById("demo").scrollLeft++;
}
}
var MyMar=setInterval(Marquee1,speed)
document.getElementById("demo").onmouseover=function() {clearInterval(MyMar)}
document.getElementById("demo").onmouseout=function() {MyMar=setInterval(Marquee,speed)}
</script>  
        </td>
    </tr>
  </tbody>
</table>
<!--#include file="Foot.asp" -->


</map></body>
</html>
搜索更多相关主题的帖子: 图片 网页 function include style 
2011-06-20 13:42
快速回复:我的滚动效果的js代码页面提示报错
数据加载中...
 
   



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

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