Serafla Posted March 14, 2022 Share Posted March 14, 2022 Hi, I posted recently about the same portfolio website I'm currently developing. I'm using a database in JS to reference data attributes for each project, and wanted to embed an mp4 video for certain projects using an if/then statement. If the project doesn't have a video, I'm using GSAP to set its display to none. However, I'm not sure if my syntax is correct for referencing the video DOM element as it's not displaying, and is causing the rest of my images in the gallery to not show. See the Pen GRygLmQ by serafla (@serafla) on CodePen Link to comment Share on other sites More sharing options...
GreenSock Posted March 15, 2022 Share Posted March 15, 2022 Looks like you've various problems here: You were missing the ending Array bracket ("]") on your projects (syntax error) localStorage.getItem("indexValue") us evaluating as null, thus projects[localStorage.getItem("indexValue")].video throws an error You didn't load GSAP in your CodePen So from what I can tell, none of this has anything to do with GSAP Let us know if there are any GSAP-related questions you need help with. Good luck! 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