Jump to content
Search Community

Pin-Spacer makes content underneath unclickable

pascalgehring

Go to solution Solved by OSUblake,

Recommended Posts

pascalgehring
Posted

I already posted a similar problem, but I later realised that the solution I received was not wo sufficient:

 

I have two scroll animations after each other. The Pin-Spacer of the first animation overlays the a tags at a certain scroll position and so there unclickable because they're overlayed by the pin-spacer. Is there any way I can make the a tags clickable? Mabe make the pin-spacer  layer not blocking or something else. (if I enable pin Spacing the a tag gets clickable but then there's a huge white space between the two animations.)

 

Thank you for your answers!

See the Pen oNGydxG by pascalgehring (@pascalgehring) on CodePen.

  • Solution
Posted

How about this? I'm just toggling a class that changes the pointer events from none to auto.

 

See the Pen mdBzEPd by GreenSock (@GreenSock) on CodePen.

 

  • Like 2
  • 2 weeks later...
pascalgehring
Posted

The toggleClass did the trick for me. I added z-index:100 for the toggleClass, because pointer-events:auto didn't seem to work.

Thank you for your Answers!

Best Wishes

Pascal

  • Like 1
  • 3 years later...
Posted

I have a simpler solution for this issue. The solutions above did not work for me. Here's my solution:

.pin-spacer { /* this class is auto created by gsap */
  pointer-events: none;
}

.content { /* this is your content container that is blocked */
  pointer-events: auto;
}

GSAP seems to auto wrap your content with a parent div that has a pin-spacer class, even when you set pinSpacing to false. The idea is to disable pointer-events on the pin-spacer (the parent), and re-enable pointer-events on your content (the child).

 

If you don't re-enable pointer-events on your content, nothing will be clickable as the parent's disabled pointer-events will apply to the child too.

  • Thanks 1

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.
×
×
  • Create New...