Hello All,
My question has to do when using the tween target. I know as far as speed that targeting elements in the DOM by ID is faster than targeting a class. I know to use document.getElementByID() when i need to target a ID.
But when it comes to other selectors ( like classes, attribute selectors, etc... ) GSAP knows to add the jQuery $() if jQuery is included in the page.
So my question is...
What is faster... to omit the $(), or include it: ??
// jQuery is loaded in the page
// Which is faster ?
// without the $
TweenMax.to(".myClass", 2, { color:"#FC0"});
// with the $
TweenMax.to($(".myClass"), 2, { color:"#FC0"});
If I include the $() does it help with speed or performance, since im including the $()
or does it not even matter?
Thanks in advance for any help with my questions