Counter-Up2 icon indicating copy to clipboard operation
Counter-Up2 copied to clipboard

How can I use this counter in multiple times ?

Open bashar-lskit opened this issue 2 years ago • 2 comments

This plugin is awesome, but I don't use the counter in multiple times.

bashar-lskit avatar Nov 01 '22 06:11 bashar-lskit

yeah! same issue, if i use the same class .counter - it only animates the first elementwith that class.

octipus avatar May 14 '23 11:05 octipus

Hello guys you can use the following code to modify the given one. Lets say that the class of the counter element is .animated_number__num

Instead of

const el = document.querySelector( '.animated_number__num' ) IO.observe( el )

Use this:

const elements = document.querySelectorAll('.animated_number__num'); elements.forEach(el => { IO.observe(el); });

ArchimidisM avatar Aug 23 '23 14:08 ArchimidisM