Skip to content

Instantly share code, notes, and snippets.

@nagarajanpp8
Created April 9, 2019 12:46
Show Gist options
  • Save nagarajanpp8/d5e58c8cf6172a8b5840791d7e4206ec to your computer and use it in GitHub Desktop.
Save nagarajanpp8/d5e58c8cf6172a8b5840791d7e4206ec to your computer and use it in GitHub Desktop.
Jquery number count animation
import Ember from 'ember';
export default Ember.Controller.extend({
appName: 'Ember Twiddle',
sample: false,
actions: {
aa(){
this.toggleProperty("sample");
$('.count').prop('Counter', 20).animate(
{
Counter: $('.count').text()
}, {
duration: 2000,
easing: 'swing',
step: function (now) {
$(this).text(Math.ceil(now));
}
});
}
}
});
<h1 {{action "aa" }}>Welcome to {{appName}}</h1>
{{#liquid-bind sample}}
sample
{{/liquid-bind}}
{{velocity-bind}}
<br>
<br>
<div id="shiva"><span class="count">200</span></div>
{{outlet}}
<br>
<br>
{
"version": "0.15.1",
"EmberENV": {
"FEATURES": {}
},
"options": {
"use_pods": false,
"enable-testing": false
},
"dependencies": {
"jquery": "https://cdnjs.cloudflare.com/ajax/libs/jquery/3.3.1/jquery.js",
"ember": "3.4.3",
"ember-template-compiler": "3.4.3",
"ember-testing": "3.4.3"
},
"addons": {
"ember-data": "3.4.2",
"liquid-fire": "0.28.0"
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment