My current setup involves a container with draggable width and multiple children within it.
https://i.sstatic.net/r7Gd1.png
When the width of the container is adjusted, only a certain number of elements can fit. For example, if only 3 elements can fit due to a decrease in width, the expected outputs are (0), (1), and (+4) representing the number of elements that overflow +1.
https://i.sstatic.net/WQ9lO.png
In other scenarios, where only two elements can fit and 4 overflow, the expected output would be displayed as two circles with (0) and (+5).
https://i.sstatic.net/agevi.png
While previous solutions often involve calculating the number of elements that can fit based on a fixed width, my dynamic case requires determining this dynamically. Can anyone provide guidance on achieving this using JavaScript and plain CSS?