Answer the question
In order to leave comments, you need to log in
How to change the name of data-attribute?
Greetings! using skrollr, it uses data-attr like ( data-0='',data-100=''...). the question is how do I change the data of the name of the data attribute itself (i.e. item.scroll100 = (100) comes to props and must be substituted into the data-(item.scroll100)='' attribute). how can this be set up?
Answer the question
In order to leave comments, you need to log in
As an option, use the render function and dynamically create an attribute.
I made an example, I think you can adapt it for yourself: codepen.io/kerf/pen/OmMqqP
In the example, the data-## attribute is dynamically created based on the scroll prop of the component
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question