Jump to content
Search Community

Mouse follow tooltip on rollover

Combustion test
Moderator Tag

Warning: Please note

This thread was started before GSAP 3 was released. Some information, especially the syntax, may be out of date for GSAP 3. Please see the GSAP 3 migration guide and release notes for more information about how to update the code to GSAP 3's syntax. 

Recommended Posts

Hi,

 

It appears #box is the tooltip and #button is the thing you want to rollover to trigger the tooltip, correct?

 

You can just add mouseenter and mouseleave events to #button that hide or show the #box.

 

The problem is that the #box will sit on top of #button when the mouse is over #button, and that triggers a mouseleave on the #button. There is a little css that you can put on #box that helps get around this

 

pointer-events:none;

 

see example here:

See the Pen 38079ce0aa948201258cf16381b0073f by GreenSock (@GreenSock) on CodePen

 

You could also offset the #box x and y values so that the tooltip is never directly layered between the mouse and the #button.

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