Jump to content
GreenSock

Search In
  • More options...
Find results that contain...
Find results in...
sarathchand19

Hover not working after pinning div element to top

Recommended Posts

I have two Div Elements Footer and Contact-pager, When the footer's top touches top of the screen, I made it pin, and it is working fine, but the hover effect which I gave to *s-i* inside footer was not working.
I tried coding in codepen, but I never used it, so I found it difficult to write in it.

Furthermore, I tried removing Pin:true, just to be sure pin is causing the hover problem, and hover worked  after removing pin.
 

image.png.63ad23234ae6e27f6dcdd8c2d4b4d3cb.pngimage.png.75dd5b0de60572f047102b322d963d86.png

Link to comment
Share on other sites

Hey there sarathchand19,


Welcome to the forums. 🥳


This sounds like a z-index issue. I'd recommend making sure the s-i element is actually able to be hovered and not being blocked by other elements on top of it.

This won't be down to GSAP itself, but a side effect of whatever styling you've applied. It's not possible to help any further without seeing a codepen or codesandbox demo though I'm afraid.

I hope this helps point you in the right direction

  • Like 3
  • Thanks 1
Link to comment
Share on other sites

Hello Cassie,

What you said is Right, After seeing your answer I inspected the code and noticed that another div element(*pin-spacer*) was added before the footer.

 

The z-index for pin-spacer was -1 so I changed it, and the hover worked

Link to comment
Share on other sites

Great! - Just a small note. It's probably a more bulletproof solution to change the z-index of the s-i element or its parent as changing the z-index for pin-spacer will also affect pin-spacers created for other scrollTriggers.

  • Thanks 1
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.
×