首页 > 其他 > 详细

JQ简单鼠标经过li滚动图片

时间:2014-04-08 09:44:39      阅读:493      评论:0      收藏:0      [点我收藏+]
<!DOCTYPE html>
<html>
<head>
<title></title>
<meta http-equiv="Content-Type" content="text/html;charset=UTF-8"/>
<style>
#shider{
width:463px;
height:300px;
margin:0 auto;
position:relative;
}
ul{
list-style:none;
}
#box{
width:463px;
height:300px;
overflow:hidden;
}
#show{
width:463px;
height:1210px;
overflow:hidden;
}
#number li{
float:left;
width:20px;
height:20px;
text-align;center;
line-height:20px;
background-color:#fff;
border:solid 1px red;
margin-left:5px;
}
#number li.on{
color:#fff;
line-height;20px;
width:20px;
height:20px;
font-size:14px;
border:none;
background:#2b5000;
font-weight:bold;
cursor:pointer;
}
 </style>
<script src="jquery-1.11.0.min.js"></script>
<script type="text/javascript">
/*$(function()
{
$("#number li").mouseover(function()
{
var x = $(this).index();
$("#show").stop().animate({"margin-top":-300*x},300);//滚动距离有兼容性问题。。自己调
});
})*/
$(document).ready(function(){
$("#number li").mouseover(function(){
var x=$(this).index();
$("#show").stop().animate({"margin-top":-300*x},300);
})
})

    </script>
</head>
<body>
<div id="shider">
<div id="box">
<div id="show">
<img src="image/1.jpg"><img src="image/2.jpg"><img src="image/3.jpg"><img src="image/4.jpg">
</div>
</div>
<ul id="number">
<li>1</li><li>2</li><li>3</li><li>4</li>
</ul>
</div>
</body>
</html>bubuko.com,布布扣

JQ简单鼠标经过li滚动图片,布布扣,bubuko.com

JQ简单鼠标经过li滚动图片

原文:http://blog.csdn.net/xiaomogg/article/details/23157689

(0)
(0)
   
举报
评论 一句话评论(0
关于我们 - 联系我们 - 留言反馈 - 联系我们:wmxa8@hotmail.com
© 2014 bubuko.com 版权所有
打开技术之扣,分享程序人生!