首页 诗词 字典 板报 句子 名言 友答 励志 学校 网站地图
当前位置: 首页 > 教程频道 > .NET > .NET Framework >

滚动图片代码在IE 6 7 8 上滚动 在谷歌 火狐不滚动什么原因

2012-08-30 
滚动图片代码在IE 67 8 下滚动 在谷歌 火狐不滚动什么原因%@ Page LanguageC# AutoEventWireuptrue

滚动图片代码在IE 6 7 8 下滚动 在谷歌 火狐不滚动什么原因
<%@ Page Language="C#" AutoEventWireup="true" CodeFile="Index.aspx.cs" Inherits="Index" %>

<!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 runat="server">
<meta http-equiv="X-UA-Compatible" content="IE=EmulateIE7" />
 <title><%=Title%></title>
  <meta name="keywords" content=<%=KeyWords %> />
  <meta name="description" content=<%=Description%> />  
  <link href="yiyan.css" rel="stylesheet" type="text/css" />  
</head>
<body>
<div style="-webkit-text-size-adjust:none;">

  <form id="form1" runat="server">  
  <div class="top"><div class="logo">
  <div class="ziti">
<span onclick="var strHref=window.location.href;this.style.behavior='url(#default#homepage)';this.setHomePage('http://www.xxyuhang.com');" style="CURSOR: hand">设为首页</span>&nbsp;&nbsp;<span style="CURSOR: hand" onClick="window.external.addFavorite('http://www.xxyuhang.com','新乡豫航')" title="新乡豫航">收藏本站</span> &nbsp;<a href="ContactUs.aspx">联系方式</a></div></div></div>  
  <div class="nav">
  <ul>  
  <li><a href="Index.aspx">网站首页</a></li> 
  <li style="width:2px"><img src="images/Body_09.gif" /></li>  
  <li><a href="CompanyInfo.aspx?InfoID=1">公司简介</a></li>
  <li style="width:2px"><img src="images/Body_09.gif" /></li>  
  <li><a href="News.aspx">新闻动态</a></li>
  <li style="width:2px"><img src="images/Body_09.gif" /></li> 
  <li><a href="Rongyu.aspx">企业文化</a></li>
  <li style="width:2px"><img src="images/Body_09.gif" /></li>
  <li><a href="PT.aspx">产品信息</a></li>
  <li style="width:2px"><img src="images/Body_09.gif" /></li>
  <li><a href="Product.aspx?ProductTypeID=14">技术支持</a></li>
  <li style="width:2px"><img src="images/Body_09.gif" /></li>
  <li><a href="ZhaoPin.aspx">人才招聘</a></li>  
  <li style="width:2px"><img src="images/Body_09.gif" /></li>
  <li><a href="LiuYan.aspx">在线留言</a></li>  
  <li style="width:2px"><img src="images/Body_09.gif" /></li>
  <li><a href="CompanyInfo.aspx?InfoID=7">联系我们</a></li>  
  <li style="width:2px"><img src="images/Body_09.gif" /></li>
  </ul>
  </div>  
  <div class="ditu">  
<object classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000" codebase="http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=7,0,19,0" width="1024" height="281">
  <param name="movie" value="images/flash.swf" />


  <param name="quality" value="high" /><param name="SCALE" value="noborder" />
  <embed src="images/flash.swf" width="1024" height="281" quality="high" pluginspage="http://www.macromedia.com/go/getflashplayer" type="application/x-shockwave-flash" scale="noborder"></embed>
  </object> 
  </div>  
  <div class="ct">
  <ul>
  <li style="width:1024px">
   
  <div class="xw"><div style="background:url(images/cplb.jpg) no-repeat left; height:32px; text-align:right; "><a href="LB.aspx"><img src="images/m.gif" style="margin-top:10px;"/></a></div>
  
  <div style="background:url(images/zcx1.jpg) no-repeat;width:285px;height:230px;padding-top:15px;">
  <asp:Repeater runat="server" ID="RPTYpe">
<ItemTemplate>
<div style="line-height:25px; height:25px; border-bottom:1px dotted #CCC; padding-left:20px;"><img src="images/biao.jpg" /> <a href='Product.aspx?ProductTypeID=<%#Eval("TypeID") %>'><%#Eval("TypeName") %></a></div>
</ItemTemplate>
</asp:Repeater> </div>
   
  </div>
   
  <div class="gs" style="padding-left:13px;"><div style="background:url(images/gsjj.jpg) no-repeat left; height:32px; text-align:right; "><a href="CompanyInfo.aspx"><img src="images/m.gif" style="margin-top:10px; "/></a></div>
  <div style=" line-height:25px;">
  <div style="line-height:25px;padding:10px 0px 10px 10px;background:url(images/zcx12.jpg) no-repeat;width:431px;height:200px;">
  <img src="images/Body52.jpg" style="float:left; padding-right:8px;" /><asp:Label runat="server" ID="lblBody"></asp:Label></div>
  </div>  
  </div>  
   
<div class="right" >
  <div style="background:url(images/qywh.jpg) no-repeat left; height:32px; text-align:right; "><a href="ContactUs.aspx"><img src="images/m.gif" style="margin-top:10px;"/></a></div>
  <div style="padding-left:10px;padding-top:20px; ">
  <asp:Repeater ID="RYTYpe" runat="server" >
  <ItemTemplate>  
  <div style=" line-height:25px; height:25px;"><span style="float:left"><img src="images/Body_28.gif" /><a href='RongYuView.aspx?RongYuID=<%#Eval("RongYuID")%>' style="color:#000"> <%# Eval("Title")%> </span></a></div>  
  </ItemTemplate>
  </asp:Repeater> 
  </div>
  </div>  
  </li>
  </ul>
  </div>
  <div style="background:url(images/dese.jpg) repeat-x bottom; overflow:hidden">
  <div class="content">
  <ul>
  <li style="width:1015px;">
  <div class="left"> 
  <div style="background:url(images/cpzs.jpg) no-repeat left; height:32px; text-align:right; padding-right:10px"><a href="PT.aspx"><img src="images/m.gif" style="margin-top:10px;"/></a></div>


  <div style="padding:10px 10px; background:url(images/Body32.jpg) no-repeat left; width: 720px;" class="cls_container">
  <div id="demo" style="padding-left:64px;margin-left:10px;overflow:hidden; width:620px; height: 150px; text-align:right; " > 
  <table align="right" border="0" cellpadding="0" cellspacing="0" > 
  <tr> 
  <td id="demo1" valign="top" > 
  <asp:DataList ID="DataList1" runat="server" RepeatDirection="Horizontal" Width="702">
  <ItemTemplate>
  <table border="0" cellpadding="0" cellspacing="0" style="text-align:left; width:702; " > 
  <tr> 
  <td style="text-align:left;">  
  <a href='ProductView.aspx?ProductID=<%#Eval("ProductID") %>'>
  <img style="height:120px; width:150px;text-align:left; margin-right:2px; border:2px solid #E2E2E2" src='SysManage/IMG/<%#Eval("ProductImgUrl") %>' ></a>
  </td>  
  </tr>
  <tr>
  <td style="height:23px; text-align:center"><a href='ProductView.aspx?ProductID=<%#Eval("ProductID") %>' style="color:#000"><%# Eval("ProductName").ToString().Length > 12 ? Eval("ProductName").ToString().Substring(0, 12) : Eval("ProductName")%></a></td>
  </tr>  
  </table>
  </ItemTemplate>
  </asp:DataList>
  </td> 
  <td id="demo2" valign="top"></td>
  </tr>
  </table> 
  </div> 
  <script type="text/javascript" language="javascript"> 
  var speed=1 
  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>
  </div>  
 

[解决办法]

HTML code
----------向上滚动---------------------<div id="demo" style="overflow:hidden;height:150px;width:270px;color:#ffffff"><div id="demo1"> <img src="http://www.baidu.com/img/baidu_logo.gif"> <img src="http://www.baidu.com/img/baidu_logo.gif"> <img src="http://www.baidu.com/img/baidu_logo.gif"> <img src="http://www.baidu.com/img/baidu_logo.gif"> <img src="http://www.baidu.com/img/baidu_logo.gif"> <img src="http://www.baidu.com/img/baidu_logo.gif"> </div> <div id="demo2"></div> </div> <script type="text/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;height:129px;width:500px;color:#ffffff"> <table align="left" cellpadding="0" cellspace="0" border="0"> <tr> <td id="demo1" valign="top"><img src="http://www.baidu.com/img/baidu_logo.gif"><img src="http://www.baidu.com/img/baidu_logo.gif"><img src="http://www.baidu.com/img/baidu_logo.gif"><img src="http://www.baidu.com/img/baidu_logo.gif"><img src="http://www.baidu.com/img/baidu_logo.gif"><img src="http://www.baidu.com/img/baidu_logo.gif"></td> <td id="demo2" valign="top"></td> </tr> </table> </div> <script type="text/javascript"> 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> 

热点排行