I'm trying to implement the following bit of code to create a hover tooltip that follows the mouse: https://jsfiddle.net/mgbv5tzx/212/

I've implemented it on my wordpress page, exactly as in the JSfiddle mentioned. However, it only works partly, the tooltip only shows statically, it doesn't follow the mouse around. It's like it's not reading the last few lines of code that deal with mouse movement (or maybe something else is going on?).

I'm using GeneratePress, with the JS code as a hook on wp_footer, CSS in SimpleCSS plugin, and HTML bit as an HTML block on a blog post.

Not sure if I should've posted this on the Javascript area instead, but the JS seems fine, there seems to be something wrong with implementing it.

Do you have any idea what may be going on? Thanks!

  • Can you show the part where you are adding the JS code to the wp_footer hook? The behavior you describe could be CSS-only (i.e. your JS is not running correctly at all). – tmdesigned Mar 12 at 14:57
  • You may be correct in that JS is not running at all. I added the code exactly as in the JSFiddle, between <script type=”javascript”></script>. Is that the correct way to go about it? – J. Stockland Mar 12 at 16:23
  • SOLVED: I had it as running for all users, when I changed that to no setting at all, it worked. Maybe somehow GeneratePress' considers the admin not as part of 'all users'? Odd. – J. Stockland Mar 12 at 16:36

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Browse other questions tagged or ask your own question.