samedi 9 juillet 2016

jquery .animate() - changes occur suddenly after the animation time, with no visible transition


I'm trying to animate the position of a div that has position:relative, like so:

$("#target").animate({
    top: '200px',
    left: '200px'
  }, 1000)

What happens is that after the time period, the attributes suddenly change to those in the .animate params. There's no apparent transition: the div sits there for a second then instantly moves to the new position.

I've tested this in a js fiddle with the same version of jquery, and it works fine.

https://jsfiddle.net/j35o8re3/

Has anyone encountered this problem? I've been googling a bit and haven't found anything useful so far. thanks, Max


Aucun commentaire:

Enregistrer un commentaire