div 태그를 300px 왼쪽으로 움직이려하고 3 초 후 숨기기로하고 8 초마다이 전체 과정을 수행하고 싶습니다. 내 코드에서는 한 번만 수행합니다. 그것은 전체 세차를 반복하지 않습니다. 다음은 내 코드입니다.div 태그에 애니메이션을 적용한 후 jquery를 사용하여 숨기기
<!DOCTYPE html>
<html>
<head>
<script src="http://ajax.googleapis.com/ajax/libs/jquery/1.11.1/jquery.min.js"> </script>
<script>
$(document).ready(function(){
window.setInterval(function(){
var div=$("div");
div.animate({left:'300px'},"slow");
setTimeout(function(){
div.animate({opacity:'0'},"slow"); }, 3000);
},8000);
});
</script>
</head>
<body>
<div style="background:#98bf21;height:100px;width:100px;position:absolute;">
</div>
</body>
</html>
멋지을! 고마워 제대로 작동합니다. B-) – gayan