css3和js实现鼠标滑过图片微移动 平滑过渡

<!doctype html>
<html>
<head>
<meta charset="utf-8">
<title>index</title>
	<script src="jquery-1.11.1.min.js"></script>
	

<body>

<div class="item">
	<a href="">
		<img src="11.jpg">
	</a>
</div>


<div class="item">
	<a href="">
		<img src="11.jpg">
	</a>
</div>

<style type="text/css">
.item{  position:relative; width:295px; height:190px;  overflow:hidden; border:1px solid;  margin:10px;}
.item a{ display:block;width:295px; height:190px;}
.item a img{
	-webkit-transition:all .3s ease;
	-moz-transition:all .3s ease;
	-ms-transition:all .3s ease;
	-o-transition:all .3s ease;
	transition:all .3s ease;
	position:absolute;
	left:0
}
.item a:hover img{ 
	position:absolute; left:-10px;
}
</style>
<script>
$(".item").bind("mouseenter", function(){
	$(this).find("img").stop(!0).animate({"left": "-10px"});
}).bind("mouseleave", function(){
	$(this).find("img").stop(!0).animate({"left": "0px"});
});
</script>
</body>
</html>

  

css3和js实现鼠标滑过图片微移动 平滑过渡,布布扣,bubuko.com

css3和js实现鼠标滑过图片微移动 平滑过渡

上一篇:ios开发中遇到的编译错误总结


下一篇:Android内存性能优化(内部资料总结) eoe转载