<!DOCTYPE html>
<html>
<head>
<metacharset="utf-8" />
<title></title>
<styletype="text/css">
div{
width:100px;
height:100px;
background-color: red;
}
</style>
<scriptsrc="js/zepto.js" type="text/javascript" charset="utf-8"></script>
<scripttype="text/javascript">
$(document).ready(function(){
$("div").click(function(){
// $("div").css({
// width:"200px"
// })
vartimer = null;
varspeed = 2;
varw = 100;
timer = setInterval(function(){
$("div").css({
width:(w+= speed)
})
if(w >= 200) {
clearInterval(timer);
}
},30)
})
})
</script>
</head>
<body>
<div></div>
</body>
</html>