jQuery animate function

A simple example of a using the jQuery animate function.
<!DOCTYPE html>
<html>
<head>
    <meta charset="utf-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0, maximum-scale=1.0">
    <meta name="description" content="jQuery example for Tizen"/>
    
    <title>jQuery example for Tizen</title>
    
<style>
	#sampleDiv {
	    position:absolute;
		background:#DD0000;
		height:120px;
		width:120px;	
	}
</style>

  <script src="js/jquery-2.1.4.min.js"></script>
  <script> 
	$(document).ready(function(){
	    $("button").click(function(){
	        $("#sampleDiv").animate({
	            left: '150px',
	            opacity: '0.8',
	            height: '150px',
	            width: '150px'
	        });
	    });
	});
</script> 
</head>
<body>

	<button>Animate!</button>
	<div id="sampleDiv"></div>

</body>
</html>

Responses

0 Replies