Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

API consistency with jQuery.animate() #169

Open
ChrisKam opened this issue Oct 14, 2013 · 0 comments
Open

API consistency with jQuery.animate() #169

ChrisKam opened this issue Oct 14, 2013 · 0 comments

Comments

@ChrisKam
Copy link

Hello,

thank you for making this awesome plugin! I'm currently migrating some Fancybox stuff over to transit.js (as the default animation looks terrible in some browsers) and I have noticed something:

In jQuery, you can pre-define an object which you then pass into .animate like so:

var ani = {
left: "+=50px",
top: "+=100px",
opacity: 1
}

and pass it in like this

$("element").animate(ani, {
duration: 500,
complete: functionname
});

which I think makes the code really nice and clean. With transit.js, I would have to do this

$("element").transition({
left: ani.left,
top: ani.top,
opacity: ani.opacity,
duration: 500,
complete: functionname
});

...which is redundant. $.extend obviously solves this issue but I really like how jQuery's animate() does that implicitly for you. For consistency's sake, I think it would be nice if jquery.transit would behave the same way.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant