tags:

views:

40

answers:

2

Hy,

i have a div with relative position (CSS) and i want to make it to move on the screen, changing the left property. This should be a smooth transition from (left: 0px;) to (left: 100px;).

Thanks

+2  A: 

You can do this with .animate() like this:

$("#myDiv").animate({ left: '100px' });

Do the reverse for the opposite animation, and set the initial left position using CSS like this:

#myDiv { left: 0; position: absolute; }
Nick Craver
+1  A: 
$('#yourDIV').animate({left:'0px',top:'100px'},1000);

where 1000 is your speed

Glennular