AsKadir Posted January 18, 2020 Share Posted January 18, 2020 Hi! I have some problem with TweenMax when trying to make a slider, I found some code in youtube and get new idea. And now I made a simple slider, everything worked fine. But then I wanted to add some animation for the next and previous slides. If you click on PREV button you could see what I want to reach with NEXT button, but when my activeSlide gets 0, I get an error: Uncaught Cannot tween a null target. What am I doing wrong? Can you help me, please? Sorry for my English. See the Pen OJPBaez by ChicagoJostik (@ChicagoJostik) on CodePen Link to comment Share on other sites More sharing options...
ZachSaucier Posted January 18, 2020 Share Posted January 18, 2020 Hey AslanGoi, This really does not look like a GSAP specific question, but more of the logic in which your custom slider pagination works. The error about the target being null means that slides[nextSlide] (the line that the error points to) is null. That means that your logic is wrong related to the next slide. Fix that and the problem will go away It looks like you (or whoever made that video) got most of the core code from this post: 1 Link to comment Share on other sites More sharing options...
AsKadir Posted January 19, 2020 Author Share Posted January 19, 2020 Thanks, Zach! Link to comment Share on other sites More sharing options...
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now