jQuery <img> animate to move left

Description

jQuery <img> animate to move left

View in separate window

<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="utf-8">
<title>Example of jQuery Animation Effects</title>
<script src="https://code.jquery.com/jquery-1.12.4.min.js"></script>
<style>
    img{/*  w  ww.  j av  a 2s .com*/
        position: relative; /* Required to move element */
    }
</style>
<script>
$(document).ready(function(){
    $("button").click(function(){
        $("img").animate({
            left: 300
        });
    });
});
</script>
</head>
<body>
    <button type="button">Start Animation</button>
    <p>
      <img src="image1.png" alt="circle">
    </p>
</body>
</html>



PreviousNext

Related