<tbody> <tr> <td> <div id="demo" style="overflow:hidden;height:120px;width:100%;"> <div id="demo1">
<scripttype="text/javascript">varspeedU=100;demo2.innerHTML=demo1.innerHTML;functionM...
<script type="text/javascript">
var speedU=100;
demo2.innerHTML=demo1.innerHTML;
function MarqueeU(){
if(demo2.offsetTop-demo.scrollTop<=0)
demo.scrollTop-=demo1.offsetHeight;
else{
demo.scrollTop++;
}
}
var MyMarU=setInterval(MarqueeU,speedU);
demo.onmouseover=function() {clearInterval(MyMarU);};
demo.onmouseout=function() {MyMarU=setInterval(MarqueeU,speedU);};
</script
请求高手 这些javascript 在ie里面可以运行 可在火狐 google里面就不行了 展开
var speedU=100;
demo2.innerHTML=demo1.innerHTML;
function MarqueeU(){
if(demo2.offsetTop-demo.scrollTop<=0)
demo.scrollTop-=demo1.offsetHeight;
else{
demo.scrollTop++;
}
}
var MyMarU=setInterval(MarqueeU,speedU);
demo.onmouseover=function() {clearInterval(MyMarU);};
demo.onmouseout=function() {MyMarU=setInterval(MarqueeU,speedU);};
</script
请求高手 这些javascript 在ie里面可以运行 可在火狐 google里面就不行了 展开
1个回答
展开全部
<!DOCTYPE html>
<head>
<title>动态导航|走马灯|</title>
<style type="text/css">
div,p{padding:0;margin:0}
#demo{overflow: hidden;border: 1px solid #ccc; height:100px;width: 500px;}
</style>
</head>
<body>
<div id="demo">
<div id="demo1">
<p>破阵子</p>
<a href="#">醉里挑灯看剑,梦回吹角连营。</a><br />
<a href="#">八百里分麾下炙,五十弦翻塞外声,沙场秋点兵。</a><br />
<a href="#">马作的卢飞快,弓如霹雳弦惊。</a><br />
<a href="#">了却君王天下事,赢得生前身后名。可怜白发生!</a><br />
<p>破阵子</p>
<a href="#">醉里挑灯看剑,梦回吹角连营。</a><br />
<a href="#">八百里分麾下炙,五十弦翻塞外声,沙场秋点兵。</a><br />
<a href="#">马作的卢飞快,弓如霹雳弦惊。</a><br />
<a href="#">了却君王天下事,赢得生前身后名。可怜白发生!</a><br />
<p>破阵子</p>
<a href="#">醉里挑灯看剑,梦回吹角连营。</a><br />
<a href="#">八百里分麾下炙,五十弦翻塞外声,沙场秋点兵。</a><br />
<a href="#">马作的卢飞快,弓如霹雳弦惊。</a><br />
<a href="#">了却君王天下事,赢得生前身后名。可怜白发生!</a><br />
</div>
<div id="demo2">
</div>
</div>
<script>
var speed = 40;
var demo = document.getElementById("demo");
var demo1 = document.getElementById("demo1");
var demo2 = document.getElementById("demo2");
demo2.innerHTML = demo1.innerHTML;
function marquee()
{
if (demo2.offsetTop-demo.scrollTop<=0)
{
demo.scrollTop-=demo1.offsetHeight;
}
else
{
demo.scrollTop++ ;
}
}
var myMarquee = setInterval("marquee()",speed);
demo.onmouseover=function(){clearInterval(myMarquee)}
demo.onmouseout=function(){myMarquee = setInterval("marquee()",speed)}
</script>
</body>
</html>
<head>
<title>动态导航|走马灯|</title>
<style type="text/css">
div,p{padding:0;margin:0}
#demo{overflow: hidden;border: 1px solid #ccc; height:100px;width: 500px;}
</style>
</head>
<body>
<div id="demo">
<div id="demo1">
<p>破阵子</p>
<a href="#">醉里挑灯看剑,梦回吹角连营。</a><br />
<a href="#">八百里分麾下炙,五十弦翻塞外声,沙场秋点兵。</a><br />
<a href="#">马作的卢飞快,弓如霹雳弦惊。</a><br />
<a href="#">了却君王天下事,赢得生前身后名。可怜白发生!</a><br />
<p>破阵子</p>
<a href="#">醉里挑灯看剑,梦回吹角连营。</a><br />
<a href="#">八百里分麾下炙,五十弦翻塞外声,沙场秋点兵。</a><br />
<a href="#">马作的卢飞快,弓如霹雳弦惊。</a><br />
<a href="#">了却君王天下事,赢得生前身后名。可怜白发生!</a><br />
<p>破阵子</p>
<a href="#">醉里挑灯看剑,梦回吹角连营。</a><br />
<a href="#">八百里分麾下炙,五十弦翻塞外声,沙场秋点兵。</a><br />
<a href="#">马作的卢飞快,弓如霹雳弦惊。</a><br />
<a href="#">了却君王天下事,赢得生前身后名。可怜白发生!</a><br />
</div>
<div id="demo2">
</div>
</div>
<script>
var speed = 40;
var demo = document.getElementById("demo");
var demo1 = document.getElementById("demo1");
var demo2 = document.getElementById("demo2");
demo2.innerHTML = demo1.innerHTML;
function marquee()
{
if (demo2.offsetTop-demo.scrollTop<=0)
{
demo.scrollTop-=demo1.offsetHeight;
}
else
{
demo.scrollTop++ ;
}
}
var myMarquee = setInterval("marquee()",speed);
demo.onmouseover=function(){clearInterval(myMarquee)}
demo.onmouseout=function(){myMarquee = setInterval("marquee()",speed)}
</script>
</body>
</html>
本回答被提问者采纳
已赞过
已踩过<
评论
收起
你对这个回答的评价是?
推荐律师服务:
若未解决您的问题,请您详细描述您的问题,通过百度律临进行免费专业咨询