How To Code : "onscroll event -> stop the player"

Thank you @Stan will check this and learn. To see If I can fix it myself (or not :slight_smile: )

yes about the 2 first error id. I don’t know why it does that error. The code is for each element populate by CMS, but what is strange is that this error happen only to the first cms element and work then, and attribute id for all elements populated in CMS, first element included (it just begin with #titre-2 instead of #titre-1 from the first slide because of the error). I was thinking it doesn’t really mater at this stage, because the id attribute works with a “+1”.
If it’s a serious error, I don’t know what it really change.

Anyway I have a bigger issue with this code that I want to change… But didn’t manage to perfectly attribute unique IDs to elements that iterate in CMS. I’m sure it’s very simple but didn’t found any people getting answers here.
I talk about it there but didn’t get any answer yet… https://discourse.webflow.com/t/dynamically-attribute-unique-ids-to-a-specific-class-name-elements-inside-a-cms-collection/183168

I’ve tried to embed code with this and a CMS " order number" field ,

<script>
var titr = element.getElementsByClassName('titre');
 titr .id = "titre-</order_number_CMS_Field/>";
</script>

but the selector unfortunately doesn’t select . I Don’t understand why…

the only selector that works is unfortunately with .getElementByID:

 
`var titr = document.getElementById('startplay')
 titr .id = "titre-</order_number_CMS_Field/>";`

but this code partially help, because I need then to attribute an ID to the element via Webflow to make it work, but in this case, the last collection element populate in CMS, is still named as before (‘#startplay’) and doesn’t change the last one with this embed code.

So that doesn’t help for my “players” code above (on first post above) which work for every player but then not the last one, because the last one is named differently. #startplay instead of #titre-12

Just begining to investigate, If I can’t resolve it, I will probably ask the help of a dev, when i’ve finish main of what i can still do by myself, with the help of the community.