jquery鼠标滑过停止,离开继续切换, 帮我写一个 谢谢。
现在鼠标放上去它还是会切换的,帮我写一下,鼠标放上就停止,其他效果都写好了。演示地址在下面图片地址上,没法发链接,只能这样了。谢谢哈。...
现在鼠标放上去它还是会切换的,帮我写一下,鼠标放上就停止,其他效果都写好了。
演示地址在下面图片地址上,没法发链接,只能这样了。谢谢哈。 展开
演示地址在下面图片地址上,没法发链接,只能这样了。谢谢哈。 展开
展开全部
function StopScrolll() //当鼠标移动到对象上面的时候停止自动滚动
{
clearTimeout(beauBeauSlide);
}
{
clearTimeout(beauBeauSlide);
}
本回答被提问者采纳
已赞过
已踩过<
评论
收起
你对这个回答的评价是?
2015-04-27
展开全部
<html>
<head>
<style>
*{
margin:0px;
padding:0px;
}
#adv_div{
border : 1px solid #aaaaaa;
margin-left:200px;
margin-top:40px;
width:548px;
height:177px;
overflow:hidden;
position:relative;
}
#adv,#index{
position:absolute;
}
ul li{
list-style:none;
display:inline;
}
ul adv{
width:548px;
height:177px;
display:block;
}
#index{
right:5px;
bottom:5px;
}
#index li{
float: left;
color: #FF7300;
text-align: center;
line-height: 16px;
width: 16px;
height: 16px;
font-family: Arial;
font-size: 12px;
cursor: pointer;
overflow: hidden;
margin: 3px 1px;
border: 1px solid #FF7300;
}
.on{
line-height: 21px;
width: 21px;
height: 21px;
font-size: 16px;
margin: 0 1px;
border: 0;
background-color:red;
font-weight: bold;
}
</style>
<script type="text/javascript" src="F:\Workspaces\_MyStudy\js\jquery-1.4.3.js"></script>
<script>
var adv_height = 177;
var adv_index = 0;
var adv_task;
$(function(){
$('#index li').mouseenter(function(){
var index = $('#index li').index(this);
showAdv(index);
});
showAdv(0);
$('#adv_div').hover(function(){
clearInterval(adv_task);
},function(){
adv_task = setInterval(function(){
showAdv(adv_index);
},2000);
}).mouseleave();
});
function showAdv(index){
$('#adv').stop(true).animate({'top':-1*adv_height*index},1000);
$('#index li').removeClass('on');
$('#index li').eq(index).addClass('on');
adv_index = index+1;
if(adv_index==5)adv_index=0;
}
</script>
</head>
<body>
<div id="adv_div">
<ul id="adv">
<li><img src="F:\Workspaces\_MyStudy\image\02_1.jpg"/></li>
<li><img src="F:\Workspaces\_MyStudy\image\02_2.jpg"/></li>
<li><img src="F:\Workspaces\_MyStudy\image\02_3.jpg"/></li>
<li><img src="F:\Workspaces\_MyStudy\image\02_4.jpg"/></li>
<li><img src="F:\Workspaces\_MyStudy\image\02_5.jpg"/></li>
</ul>
<ul id="index">
<li>1</li>
<li>2</li>
<li>3</li>
<li>4</li>
<li>5</li>
</ul>
</div>
</body>
</html>
<head>
<style>
*{
margin:0px;
padding:0px;
}
#adv_div{
border : 1px solid #aaaaaa;
margin-left:200px;
margin-top:40px;
width:548px;
height:177px;
overflow:hidden;
position:relative;
}
#adv,#index{
position:absolute;
}
ul li{
list-style:none;
display:inline;
}
ul adv{
width:548px;
height:177px;
display:block;
}
#index{
right:5px;
bottom:5px;
}
#index li{
float: left;
color: #FF7300;
text-align: center;
line-height: 16px;
width: 16px;
height: 16px;
font-family: Arial;
font-size: 12px;
cursor: pointer;
overflow: hidden;
margin: 3px 1px;
border: 1px solid #FF7300;
}
.on{
line-height: 21px;
width: 21px;
height: 21px;
font-size: 16px;
margin: 0 1px;
border: 0;
background-color:red;
font-weight: bold;
}
</style>
<script type="text/javascript" src="F:\Workspaces\_MyStudy\js\jquery-1.4.3.js"></script>
<script>
var adv_height = 177;
var adv_index = 0;
var adv_task;
$(function(){
$('#index li').mouseenter(function(){
var index = $('#index li').index(this);
showAdv(index);
});
showAdv(0);
$('#adv_div').hover(function(){
clearInterval(adv_task);
},function(){
adv_task = setInterval(function(){
showAdv(adv_index);
},2000);
}).mouseleave();
});
function showAdv(index){
$('#adv').stop(true).animate({'top':-1*adv_height*index},1000);
$('#index li').removeClass('on');
$('#index li').eq(index).addClass('on');
adv_index = index+1;
if(adv_index==5)adv_index=0;
}
</script>
</head>
<body>
<div id="adv_div">
<ul id="adv">
<li><img src="F:\Workspaces\_MyStudy\image\02_1.jpg"/></li>
<li><img src="F:\Workspaces\_MyStudy\image\02_2.jpg"/></li>
<li><img src="F:\Workspaces\_MyStudy\image\02_3.jpg"/></li>
<li><img src="F:\Workspaces\_MyStudy\image\02_4.jpg"/></li>
<li><img src="F:\Workspaces\_MyStudy\image\02_5.jpg"/></li>
</ul>
<ul id="index">
<li>1</li>
<li>2</li>
<li>3</li>
<li>4</li>
<li>5</li>
</ul>
</div>
</body>
</html>
本回答被网友采纳
已赞过
已踩过<
评论
收起
你对这个回答的评价是?
推荐律师服务:
若未解决您的问题,请您详细描述您的问题,通过百度律临进行免费专业咨询