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

Can you have 2 animations on one data context? #38

Open
tyler-dunkel opened this issue Jul 10, 2015 · 2 comments
Open

Can you have 2 animations on one data context? #38

tyler-dunkel opened this issue Jul 10, 2015 · 2 comments

Comments

@tyler-dunkel
Copy link

I wanna have a sliding animation similar to how mobile swiping would work however this would work with two separate buttons and be in the browser. What I would want is to be able to change the animation within a Template.events({}) such that a click on the right button would have the data slide-to-right and a click on the left button would have the data slide-to-left. is this at all possible?

@tmeasday
Copy link
Member

Hey @tdmoneybanks - you might want to check out the iron-router plugin from https://github.com/percolatestudio/momentum-iron-router/blob/master/momentum-iron-router.js. It has a concept of "choosing" between plugins a runtime.

At the moment there's nothing in momentum to allow you to do it easily but we have considered a dynamic plugin in the past..

@tyler-dunkel
Copy link
Author

Thanks for the answer @tmeasday! I've checked out the iron router plugin along with my current solution which is similar to a dynamic plugin. Essentially what i need isn't a plugin that changes but actually having two separate animations defined on one data context at the same time. What my current extension does which is a total hack is have the event change a reactive var that uses tracker to change what plugin is defined on the animation by removing it as well as its wrapping dom node and then replacing it. Any way I suppose maybe this is a feature request than but either way nice package and thanks for the help!

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

2 participants