<input type="file" onchange="do_css();">
var number = 1;
function do_css(){
var i= 1;
setInterval(function(){
$(".div_"+number).css({"width":i+"%"})
i = i+1;
},1000)
number+1;
}
what you want to achieve is that input starts to animate after triggering change (as shown in the code, each trigger is animated by a different element)
but later found a problem: the animation effect starts after the first event is triggered. If the second event is triggered immediately at this time, the animation of the last event will stop immediately, and only the later event will proceed normally. What"s going on, such as the above code reorganization, how should it be written?