Q:

Animate using offset property

I have page with some div which have relative position and i want to animate them to specific position of the screen.Therfore i can't use
$("div").animate({top:269,left:529});

I need to animate their offset like
$("div").animate({$(this).offset().top:269,$(this).offset().left:529});

But it's not working

A:

Relatively positioned elements are part of the flow. Animating your div's position would shift all the elements that follow it.
Still, if you want to do it with a relative div, then just calculate the offset:
$(this).animate({
    top: 269-$(this).offset().top,
    left: 529-$(this).offset().left
});

