question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Can't click tooltips over an SVG

See original GitHub issue

I have a SVG map that I’m applying tooltips to. Everything is working nicely, except I can’t click a link in the tooltip. I upgraded to TT4, and that didn’t solve the issue.

Visible here: http://bostonlanding.stagewp.co

Code calling in TT:

            $('g g').tooltipster({
                content: 'Loading...',
                trigger: 'click',
                functionBefore: function(instance, helper) {
                    var $origin = $(helper.origin);
                    var slug = $origin.attr('id');
                    if ( '_' == slug.substring(0,1) ) {
                        slug = slug.substring(1);
                    }
                    var ajaxURL = 'http://bostonlanding.stagewp.co/wp-json/boston-landing-map/v1/tooltip?slug=' + slug;

                    // we set a variable so the data is only loaded once via Ajax, not every time the tooltip opens
                    if ($origin.data('loaded') !== true) {

                        $.get(ajaxURL, function(data) {

                            // call the 'content' method to update the content of our tooltip with the returned data
                            instance.content( $(data.html) );

                            // to remember that the data has been loaded
                            $origin.data('loaded', true);
                        });
                    }
                }
            });

Issue Analytics

  • State:closed
  • Created 7 years ago
  • Comments:8

github_iconTop GitHub Comments

1reaction
louisamelinecommented, Jun 7, 2016

Glad it worked. Thanks!

0reactions
mckernanincommented, Jun 7, 2016

var derp = true; Totally fixed now. Thank you! Love the plugin.

Read more comments on GitHub >

github_iconTop Results From Across the Web

Can't click tooltips over an SVG · Issue #562 · calebjacob/tooltipster ...
I have a SVG map that I'm applying tooltips to. Everything is working nicely, except I can't click a link in the tooltip....
Read more >
How to show a tooltip after clicking an SVG? - Stack Overflow
Looks to me like you never specified to show the tool-tip ;). document.querySelector('svg').addEventListener('click', function() { document.
Read more >
Positioning a Tooltip on an SVG - CodePen
If you want to confirm that the positions of the tooltips adjust to the current state of the SVG, press "Wiggle the SVG"...
Read more >
Tooltip - Peter Collingridge
The first thing to do is to add a <text> element at the end of your SVG so it will be drawn over...
Read more >
Adding tooltips to SVG graphics | Journocode.com
In this tutorial, we'll show you a way to add tooltips to your SVG graphics. ... A big advantage SVG graphics have over...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found