javascript - Passing two numbers for each visible image -


i've got multiple images common class. user able hide or make them visible.

i need pass 2 numbers each visible image. starting number should 0 , should continues number. i've done far.

the current output 0,1,1,2,2,3....

i want output 0,1,2,3,4,5,....

$('#passnum').click(function(){     var curnumber= 0;     $('.visibeimage:visible').each(function(){           usenumber(curnumber++);     }); }); 

note: first number should 0

pass default index parameter in each function instead of manually iterating

$('.visibeimage:visible').each(function(index, value){       usenumber(index + 1); }); 

Comments

Popular posts from this blog

python - pip install -U PySide error -

arrays - C++ error: a brace-enclosed initializer is not allowed here before ‘{’ token -

cytoscape.js - How to add nodes to Dagre layout with Cytoscape -