I am a new in jquery so can you help me why this command doesnt animate? Animation not working, and "letter" returns in previous position without animation, so callback fires before animation, and if i am not using done or complete - animation works. Even if i use .animation.promise().done(xxxx) - xxx starts before animation. Main question is how make .css("position","static") after animation?
$("#DestinationLetter0").animate({
top: 203,
left: 80
}, {
duration: 4000,
done: (function(w1, w2) {
$("#DestinationLetter0").css(w1, w2)
})("position", "static")
});
Example code provided below
<html>
<head>
<title>AJAX</title>
<meta charset="utf-8" />
<script type="text/javascript" src="jquery.js"></script>
<script type="text/javascript">
$(document).ready(function(){
$("#DestinationLetter0").css({position:"absolute"}).animate({top:200,left:200},9000);
$("#DestinationLetter0").click(function(){$("#DestinationLetter0").animate({
top: 50,
left: 50
}, {
duration: 4000,
done: (function(w1, w2) {
$("#DestinationLetter0").css(w1, w2)
})("position", "static")
})});
})
</script>
</head>
<body>
<div><p id="in3"><span id="DestinationLetter0">A</p></div>
</body>
</html>```