Jump to content
GreenSock

_hedura_

initializing Flip breaks code

Recommended Posts

I am new to the flip plugin and I would like to include it to a click event for my page. When I initialize it by adding the "registerplugin" to the top of my page my code stops working. How do I get Flip to work with my current JS?  The code is very simple

 

```

gsap.registerPlugin(Flip);
const pop = document.querySelector(".pop");
const popExit = document.querySelector(".pop-exit");
 
document.querySelector(".img-1").addEventListener("click", () => {
  pop.style.visibility = "initial";
});
popExit.addEventListener("click", () => {
  pop.style.visibility = "hidden";
});
```
Link to comment
Share on other sites

Hi @_hedura_. Welcome to the forums. 

 

It's pretty much impossible to troubleshoot by just looking at a small excerpt of code. Can you please provide a minimal demo that clearly shows the problem? I wonder if you just forgot to load Flip plugin. Are you seeing any errors in the console? 

Link to comment
Share on other sites

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 account

Sign in

Already have an account? Sign in here.

Sign In Now
  • Recently Browsing   0 members

    • No registered users viewing this page.
×