Moving division control to the left /right side.

vishalneeraj-24503
Posted by vishalneeraj-24503 under jQuery category on | Points: 40 | Views : 1042
We know that HTML controls are static by-default.To move the position,we have to set position to relative,fixed, or absolute.

<head>
<script src="http://ajax.googleapis.com/ajax/libs/jquery/1.11.1/jquery.min.js"></script>
<script>
$(document).ready(function(){
$("button").click(function(){
$("div").animate({left:'500px'});
});
});
</script>
</head>

<body>
<p>dot net funda.com</p>
<div style="background:lightyellow;height:300px;width:300px;position:absolute;">
</div>
</body>

For moving position to the right hand side,just set as below:-
$("div").animate({right:'500px'});

Comments or Responses

Login to post response