在ie里面能正常运行,但是在火狐里面完全没有效果,浏览器兼容问题是整死人不偿命,急求高手帮忙解决!!谢谢!!
<script>
var speed=40 //调整滚动速度
m0.innerHTML=mtext.innerHTML
function Marquee(){
if(m0.offsetTop-maq.scrollTop<=0)
maq.scrollTop-=mtext.offsetHeight
else{
maq.scrollTop++
}
}
var MyMar=setInterval(Marquee,speed)
maq.onmouseover=function() {clearInterval(MyMar)}
maq.onmouseout=function() {MyMar=setInterval(Marquee,speed)}
</script>
<div id="demo" style="overflow:hidden;height:100px;width:600px;">
<table>
<tr>
<td id="demo1" valign=top class="mqC">
========================在这个地方放图片======================ffffffffffffffffffffffffffffffffffffffffffffffffffffffff
</td>
<td id="demo2" valign=top></td>
</tr>
</table>
</div>
<script type="text/JavaScript">
var speed =10; // 间歇
demo2.innerHTML = demo1.innerHTML;
function Marquee() {
if (demo2.offsetWidth-demo.scrollLeft <= 0) {
demo.scrollLeft -= demo1.offsetWidth;
} else {
demo.scrollLeft += 1;
}
}
var MyMar = setInterval(Marquee, speed);
demo.onmouseover=function() {
clearInterval(MyMar);
};
demo.onmouseout=function() {
MyMar = setInterval(Marquee,speed);
};
</script>
图片太大了。
自己改一下啊! 兼容IE8与火狐
<div runat="server" visible="false">
<table border="0" cellspacing="0" cellpadding="0" >
<tr>
<td valign="top">
<table cellspacing="0" cellpadding="0" width="967" border="0">
<tr>
<asp:Repeater runat="server">
<ItemTemplate>
<td>
<a href="Image/Company/<%#Eval("strimg")%>" target="_blank">
<div ><img src="Image/Company/<%#Eval("strimg")%>" width="200" height="180" border="0" /></div>
</a>
</td>
</ItemTemplate>
</asp:Repeater>
</tr>
</table>
</td>
<td ></td>
</tr>
</table>
<script type="text/javascript">
var speed1=15 //控制速度,数越多速度越慢
$("#demon2").html(demon1.innerHTML);
function Marquee()
{
if(demon.scrollLeft>=demon1.scrollWidth)
{ demon.scrollLeft=0 }
else{
demon.scrollLeft++
}
}
var MyMar=setInterval(Marquee,speed1)
demon.onmouseover=function() {clearInterval(MyMar)}
demon.onmouseout=function() {MyMar=setInterval(Marquee,speed1)}
</script>
</div>
用firebug进行调试,根据错误提示自己去解决,顺便也提升了自己的编程能力...