Hi Jack,
Thanks again for taking the time to look at this, I appreciate it. Answers below:
1. Are you saying that you think GSAP itself is internally keeping references to DOM elements, even when those animations are killed?
Yes, I believe so. Else there is something fundamental I'm not understanding.
2. Do you see the same results when animating it without GSAP? If so, can you provide a reduced test case comparison?
No, the issue does not occur when using jQuery.animate alone, without including the jquery.gsap file. See attached file JQueryTest.html
3. Do you get the same results if you use GSAP's API directly (not going through jQuery)? Like TweenMax.to(...) instead of jQuery.animate(...)
Yes, you get the same issue when doing TweenMax.to
4. Is there a direct correlation with the number of animations? In other words, you mentioned 12 detached elements at the start, then 24. If you add another 10 animations, does the count get affected accordingly?
It does increase:
1 tween on a div containing 1 image generates 12 additional detached elements as reported.
3 tweens on 3 divs containing 1 image each generates 26 detached elements.
I read in another post that GSAP may always keep a reference to the last thing tweened, which would be fine, but as you can see, i don't think it's storing just the last one, as it increases with multiple tweens.
Many thanks,
Alex
JQueryTest.html
jquery-3.0.0.min.js