Share Posted September 14, 2016 Hello, Is it possible to pass $(this) into a timeline so that I can access $(this) as well as the data attributes of an object? In the example pen I'd like to pass data attribute values from buttons into the timeline, ultimately to fade between two images - only after they have each fully loaded. Thanks. See the Pen GjkAyW by rfenik (@rfenik) on CodePen Link to post Share on other sites
Share Posted September 14, 2016 Thanks for the demo. I don't think things are going to work the way you are hoping (unless I'm misunderstanding). When a timeline is built it needs to know what the targets and values of all the tweens will be. I get the impression you hope to build one timeline and then have it play at different times with different targets and values as the value of $(this) changes based on what button is clicked. I think for this situation you want to create a function that you pass $(this) into and then that function will create a new timeline with all the right values pertaining to the new image you want to display. 1 Link to post Share on other sites