If I have the variables below
$(document).ready(function() {
var minsecond = 1;
var maxseconds = 4;
var updateinterval = 1;
var interval = updateinterval*1000;
window.setInterval(function(){
var currentseconds = ; //value increasing by 1 every var updateinterval (value) in seconds from var minsecond value until it reaches var maxseconds and resetting to var minsecond value and cycling again
$("span").html(currentseconds);
}, interval);
});
How do I create a counter which starts at value of var minsecond and goes up by 1 every var updateinterval in seconds to the value var maxsecond and then restarting at var minsecond
http://jsfiddle.net/TnNhA/
How about this:
jsFiddle Example