There is a container that contains a group of elements, an example in the snippet.
It has a certain width that can vary and contains an overflow: hidden style, i.e. part of the elements is not visible.
.list { overflow: hidden; white-space: nowrap; width: 200px; } .list li { display: inline-block; } <ul class="list"> <li>text 1</li> <li>text 2</li> <li>text 3</li> <li>text 4</li> <li>text 5</li> <li>text 6</li> </ul> Using JavaScript or jQuery, you need to select only those li that are visible within the 200px width; but it is necessary to take into account the moment that this width can be different and can vary.