一张图片无限放大缩小效果

<img src="img/putao.png" width="100px" height="80px">

  

<script type="text/javascript" src="js/jquery-1.10.2.min.js"></script>
<script type="text/javascript">
	$(function() {
		setInterval(function(){
			$('img').each(function() {
				var wValue = 1.5 * $(this).width();
				var hValue = 1.5 * $(this).height();
				$(this).animate({
					 wValue,
					height: hValue,
					left: ("-" + (0.5 * $(this).width()) / 2),
					top: ("-" + (0.5 * $(this).height()) / 2)
				}, 1000);
			}).each(function() {
				$(this).animate({
					 "100",
					height: "80",
					left: "0px",
					top: "0px"
				}, 1000);
			});
		},2000);		
	});
</script>

  

原文地址:https://www.cnblogs.com/yyy251/p/11510832.html