How or where can i get a counter something similar to this? I am aware of the sliders but the counter in the slider is something i am looking for and developing the website with HTML5, jquery.
Asked
Active
Viewed 2,424 times
0
-
And what are you counting? Should it just be an increasing number? – Jonas Grumann Jul 31 '13 at 07:54
-
yes, its an increasing number. can you please suggest me here. – user2619093 Jul 31 '13 at 08:05
1 Answers
2
I'm not sure I got the question 100%, anyway, here's my attempt:
var Counter = function(options) {
var start = options.start;
this.init = function() {
var self = this;
var t = window.setInterval(function() {
start+=1;
self.render(start);
}, options.interval)
}
this.render = function(number) {
var stringVal = number.toString();
var arr = stringVal.split('');
for(var i = 0; i < arr.length ; i++) {
$('.number').eq(i).text(arr[i]);
}
}
this.init();
}
var counter = new Counter({
start: 123456777,
interval: 1000 //milliseconds
});

Jonas Grumann
- 10,438
- 2
- 22
- 40