Share Posted February 12, 2013 Hi, Can someone help me with this? I want it so when you roll over #box the tooltip (or ball in this case) appears and follows the mouse. When you roll out of #box the tooltip will fade away. This is where I am so far: See the Pen IguFo by hrk (@hrk) on CodePen Any ideas on how to do this? Thanks Link to comment Share on other sites More sharing options...
Share Posted February 12, 2013 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. 1 Link to comment Share on other sites More sharing options...
Author Share Posted February 12, 2013 Hi, thanks great thanks. I'll move the tooltip so the mouse never goes over it so i can use the pointer icon. Cheers Link to comment Share on other sites More sharing options...
Share Posted February 13, 2013 If your tooltip is not directly under the mouse that would work best. While pointer-events is very useful, it has no effect on any version of Internet Explorer. http://caniuse.com/pointer-events. http://www.vinylfox.com/forwarding-mouse-events-through-layers/ offers a solution that would also work on IE. Link to comment Share on other sites More sharing options...
Share Posted February 13, 2013 Thanks Jamie. I appreciate the tip! 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