I'm really new with handlebars.js maybe this is an easy question but I can't figure it out.
Is there a way to animate the template when I send new data using $('#content').html(html); ?
Something like a CSS3 transition or jQuery Animation.
I don't know if that is possible, if so, where to do it.
Thanks
Well I was downvoted but I think my answer will help others.
What I did was to first hide the #content DIV using jQuery's .hide() after the handlebar code. When handlerbar is done I re show the div using JQuery's .show:
function animals(){
$('#content').hide('fast'); // ANIMATED CLASS REMOVED
showTemplate(categories_template,animals_data); // Handlbars stuff
$('#content').show('fast'); // ANIMATED CLASS RE ADDED
}
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With