Can't click tooltips over an SVG
See original GitHub issueI 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:
- Created 7 years ago
- Comments:8
Top 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 >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
Glad it worked. Thanks!
var derp = true;
Totally fixed now. Thank you! Love the plugin.