Hi all,
I want to do a fadeIn-fadeOut effect which is similar to this GreenSock Codepen Sample GreenSock Codepen sample. The difference is that I need to push data from the HTML so I thought of using data attributes. However, I have three scenarios I am encountering.
Scenario 1 - As seen from my codepen below, the very first entry doesn't get cycled through because there's no data attribute. it does show on page load.
Scenario 2 - If I do have a data attribute, it will display `first heading` twice. One on page load, and the next due to the animation.
Scenario 3 - I could have everything as a data attribute and leave the content of `p` empty, but the problem is on page load the `subtext` will be empty because the animation will start to run with the duration of 1. It would look empty on page load.
This could might as well be a logic issue as well so there might be a workaround. The final outcome I am hoping is similar to the original codepen, but I can pass data through the attributes without duplication. Any advice is appreciated!