Haikal Nashuha
Haikal Nashuha

Reputation: 3048

Meteor Triggering Animation During Reactivity

I want my <div> to slideToggle whenever a reactive change occurs, but so far I cannot make it happen. I tried using JQuery in the rendered and created events of the template, but it didn't fire.

What is the proper place to trigger this? For example I have this chunk of code:

<div id='demo'>Hello {{name}}</div>

The {{name}} helper depends on session variable values. If the session variable changes, I want the div to slideToggle to reflect the changes to user. How can I do this?

Upvotes: 2

Views: 525

Answers (1)

Jeremy S.
Jeremy S.

Reputation: 4639

See this thread from earlier today. Meteor has introduced animation hooks for this purpose as the jquery animations generally will not work out of the box in cases where templates are being added and removed from the DOM.

Upvotes: 2

Related Questions