<script type="text/javascript" src="./Scripts/jquery-1.5.1.min.js"></script>
<script type='text/javascript' >
$(document).ready(function () {
$("#start").animate({ left: "+=10px" }, 1000)
.animate({ left: "-5000px" }, 1000);
});
</script>
<p id="start">this is some text that i am going to animate </p>
I am racking my brain here as to why this doesn't animate. If I change left
to marginLeft
it will work as expected and animates. But i am not sure why left
doesn't.
Can anyone explain please? I have seen many other scripts doing something similar.
#start
? It needs to be positioned absolutely (position: absolute
) or fixed (position: fixed
).