David Rhoden
Content Type
Profiles
Forums
Store
Blog
Product
Showcase
FAQ
Downloads
Posts posted by David Rhoden
-
-
Got back
null
. I'm writing that selector wrong.
(Thanks for answering my question, very helpful.)But also: I tried just hard-coding a selector that I know exists (
article class5
) and still gotscrollTo target doesn't exist.
DoesscrollTo
maybe only work with an ID? -
Thanks, that's exactly what I'm looking for (what I'm feeding into the tween, specifically what
scrollTo target
value is expected) but my code doesn't have asections
array like the above example, so I'll have to figure out something else.
I just havegsap.to(window, {duration: 1, scrollTo:"article class" + (index + 1)});
and then in the HTML a series of articles with incremented classes, like "article class1, article class2
", etc. My classes are there in the HTML. Maybe I wrote that scrollTo value in a non-working way.
I'll see what I can do about a demo. -
If you wanted to console.log the scrollTo target, how would you do it?
I'm getting this error, but I'm pretty sure the target _does_ exist. I want to see what gsap _thinks_ the scrollTo target is.
Switch classes of links when scroll the page
in GSAP
Posted
Ah....you found me out. It needs to be
article.class5
(no space), AND I also had to putclass="class5"
in the HTML...thanks. You've been very helpful. It's working now.