【发布时间】:2018-02-18 22:19:32
【问题描述】:
这是循环云的代码,动画从右到左循环,我想让云在点击时可以调整大小,但我不知道该怎么做......
<!DOCTYPE>
<html>
<head>
<meta charset="UTF-8">
<link rel="stylesheet" type="text/css" href="style.css">
<script src="https://ajax.googleapis.com/ajax/libs/jquery/3.2.1/jquery.min.js"></script>
</head>
<body>
<div id="clouds">
<img border="0" alt="animated clouds" src="clouds.png">
<script>
$(document).ready(function() {
function loop() {
$('#clouds').css({right:0});
$('#clouds').animate ({right: '+=1400'}, 5000, 'linear', function() {
loop();
});
}
loop();
});
</script>
</div>
</body>
</html>
这是我尝试调整云大小的方法:
$("#clouds").click(function() {
$("size").animate({"height" : "350"}, 500);
});
还有 CSS:
#clouds {
position:absolute;
z-index:500;
right:0px;
top:10px;
}
【问题讨论】:
标签: javascript jquery html css jquery-animate