0

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!

3
  • 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
    Commented Mar 12, 2019 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? Commented Mar 12, 2019 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. Commented Mar 12, 2019 at 16:36

0

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Browse other questions tagged or ask your own question.