寻求一段JS代码:滚动的动画,鼠标一放上去就停住,点击可以进入相应的链接页面,JS代码
2个回答
展开全部
例子:
<a href="a.htm"拦野州 >
<marquee id=note5 onmouseover="this.stop()" onmouseout=this.start(); direction="up" scrollamount="1" scrolldelay="110"脊衡 height="100px" width="简蔽150px" >
文字<br>文字
</marquee></a>
<a href="a.htm"拦野州 >
<marquee id=note5 onmouseover="this.stop()" onmouseout=this.start(); direction="up" scrollamount="1" scrolldelay="110"脊衡 height="100px" width="简蔽150px" >
文字<br>文字
</marquee></a>
已赞过
已踩过<
评论
收起
你对这个回答的评价是?
展开全部
IE,FF兼容的 ,看看是不是你要的意思
<style type="text/css">
body,div{ margin:0; padding:0}
.scroll_div{ margin:0 auto; width:580px; height:62px; white-space: nowrap; overflow:hidden}
.scroll_div img{margin:auto 8px; border:solid 1px #ccc; width:120px; height:60px; }
.scroll_div li,.scroll_div ul,#scroll_begin,#scroll_end{ display:inline}
</style>
<script type="text/javascript">
function ScrollImgLeft(){
var speed = 20;
var scroll_begin=document.getElementById("scroll_begin");
var scroll_end=document.getElementById("scroll_end");
var scroll_div=document.getElementById("scroll_div");
scroll_end.innerHTML=scroll_begin.innerHTML;
function Marquee(){
if(scroll_end.offsetWidth-scroll_div.scrollLeft<=0)
scroll_div.scrollLeft-=scroll_begin.offsetWidth ;
else
scroll_div.scrollLeft++
}
var MyMar=setInterval(Marquee,speed);
scroll_div.onmouseover=function(){clearInterval(MyMar)}
scroll_div.onmouseout=function(){MyMar=setInterval(Marquee,speed)}
}
</script>
<div id="scroll_div" class="scroll_div">
<div id="scroll_begin">
<ul>
<li><a href="#"><img src="http://www.1netmedia.net/images/main_logo.gif" /></a>仿罩</li>
<li><a href="#"><img src="http://www.1netmedia.net/images/main_logo.gif" /></a></li>
<备大闹li><a href="#"><img src="http://www.1netmedia.net/images/main_logo.gif" /></a></li>
<li><a href="仿滑#"><img src="http://www.1netmedia.net/images/main_logo.gif" /></a></li>
<li><a href="#"><img src="http://www.1netmedia.net/images/main_logo.gif" /></a></li>
<li><a href="#"><img src="http://www.1netmedia.net/images/main_logo.gif" /></a></li>
<li><a href="#"><img src="http://www.1netmedia.net/images/main_logo.gif" /></a></li>
<li><a href="#"><img src="http://www.1netmedia.net/images/main_logo.gif" /></a></li>
<li><a href="#"><img src="http://www.1netmedia.net/images/main_logo.gif" /></a></li>
</ul>
</div>
<div id="scroll_end"></div>
</div>
<script type="text/javascript">ScrollImgLeft();</script>
<style type="text/css">
body,div{ margin:0; padding:0}
.scroll_div{ margin:0 auto; width:580px; height:62px; white-space: nowrap; overflow:hidden}
.scroll_div img{margin:auto 8px; border:solid 1px #ccc; width:120px; height:60px; }
.scroll_div li,.scroll_div ul,#scroll_begin,#scroll_end{ display:inline}
</style>
<script type="text/javascript">
function ScrollImgLeft(){
var speed = 20;
var scroll_begin=document.getElementById("scroll_begin");
var scroll_end=document.getElementById("scroll_end");
var scroll_div=document.getElementById("scroll_div");
scroll_end.innerHTML=scroll_begin.innerHTML;
function Marquee(){
if(scroll_end.offsetWidth-scroll_div.scrollLeft<=0)
scroll_div.scrollLeft-=scroll_begin.offsetWidth ;
else
scroll_div.scrollLeft++
}
var MyMar=setInterval(Marquee,speed);
scroll_div.onmouseover=function(){clearInterval(MyMar)}
scroll_div.onmouseout=function(){MyMar=setInterval(Marquee,speed)}
}
</script>
<div id="scroll_div" class="scroll_div">
<div id="scroll_begin">
<ul>
<li><a href="#"><img src="http://www.1netmedia.net/images/main_logo.gif" /></a>仿罩</li>
<li><a href="#"><img src="http://www.1netmedia.net/images/main_logo.gif" /></a></li>
<备大闹li><a href="#"><img src="http://www.1netmedia.net/images/main_logo.gif" /></a></li>
<li><a href="仿滑#"><img src="http://www.1netmedia.net/images/main_logo.gif" /></a></li>
<li><a href="#"><img src="http://www.1netmedia.net/images/main_logo.gif" /></a></li>
<li><a href="#"><img src="http://www.1netmedia.net/images/main_logo.gif" /></a></li>
<li><a href="#"><img src="http://www.1netmedia.net/images/main_logo.gif" /></a></li>
<li><a href="#"><img src="http://www.1netmedia.net/images/main_logo.gif" /></a></li>
<li><a href="#"><img src="http://www.1netmedia.net/images/main_logo.gif" /></a></li>
</ul>
</div>
<div id="scroll_end"></div>
</div>
<script type="text/javascript">ScrollImgLeft();</script>
本回答被提问者采纳
已赞过
已踩过<
评论
收起
你对这个回答的评价是?
推荐律师服务:
若未解决您的问题,请您详细描述您的问题,通过百度律临进行免费专业咨询