본문 바로가기

jQuery

[jQuer] 움직이는 애니메이션

반응형

[jQuer] 움직이는 애니메이션


 animate.html

<!doctype html>
<html lang="ko">
<head>
<meta charset="UTF-8">
<title>움직이는 애니메이션</title>
<style text="type/css">
div {
    background-color:orange;
    width:150px;
    height:150px;
    position:relative;
}
</style>
<script type="text/javascript" src="http://code.jquery.com/jquery-1.11.3.min.js"></script>
<script type="text/javascript">
    jQuery(document).ready(function() {

        jQuery("#btn").click(function() {

            jQuery("div").animate({left:"600"},3000).animate({left:"0"},3000);
        });   
    });
</script>
</script>
</head>
<body>
    <h1>애니메이션</h1>
    <hr/>
    <div></div>
    <button type="button" id="btn">이동</button>
</body>
</html>
 출력결과


반응형