Skip to content

Instantly share code, notes, and snippets.

Created February 3, 2012 09:31
Show Gist options
  • Save anonymous/1729309 to your computer and use it in GitHub Desktop.
Save anonymous/1729309 to your computer and use it in GitHub Desktop.
jquery.transit: problem with delay:0
<!DOCTYPE html>
<html>
<head>
<script src='https://ajax.googleapis.com/ajax/libs/jquery/1.7.1/jquery.min.js'></script>
<script src='https://raw.github.com/rstacruz/jquery.transit/master/jquery.transit.js'></script>
<script>
$(document).ready(function(){
$("#anim").transit({x:500, delay:0}, 1000, "in-out", function(){
alert("completed first animation"); //never called
});
//now x = 500, y = default
$("#anim").transit({y:500}, 1000, "in-out", function(){
alert("completed second animation"); //never called
});
//now x = 500, y = default
// -- should be x = 500, y = 500
});
</script>
<title>TEST</title>
</head>
<body>
<div id="anim" style="position:absolute; width:400px; height:300px; background:red;"></div>
</body>
</html>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment