<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<meta http-equiv="X-UA-Compatible" content="ie=edge">
<title>Document</title>
<style>
#box {
position: relative;
left: 0;
top: 0;
width: 150px;
height: 150px;
background: blue;
}
</style>
</head>
<body>
<button id="move">move</button>
<button id="stop">stop/finish</button>
<div id="box">hello</div>
<script src="lib/jquery-2.0.3.js"></script>
<script>
$(function(){
// $("#box").animate({width:'200px',height:'200px'},1000);
// $("#box").animate({left:'200px',top:'200px','font-size':'24px'},1000);
$('#move').click(function(){
// $("#box").animate({left:'+=20px',top:'+=20px','font-size':'24px'},1000);
$("#box").animate({width:'300px',height:'300px'},6000);
});
$('#stop').click(function(){
// $('#box').stop();
$('#box').finish();
});
var t = setInterval(function() {
$("#box").animate({ left: "+=20px", top: "+=20px", "font-size": "24px" }, 1000);
}, 100);
});
</script>
</body>
</html>