I want to show an image in a tooltip when you have your mouse on a link. I'm using HTML, CSS and JAVASCRIPT/JQUERY. I have my image saved in a folder so I reference it from localhost.
I have tried to set the content of the tooltip vía JQuery:
$(document).ready(function() {
$('#informe').tooltip("option","content","<img src='images/reports/informeInversiones.PNG' />");
$('#informe').tooltip("option","html","true");
$('#informe').tooltip("option","animated","fade");
$('#informe').tooltip("option","placement","bottom");
});
And I have tried to set the content of the tooltip in pure HTML:
<td colspan="2" id="informe" data-toggle="tooltip" title="<img src='images/reports/informeInversiones.PNG'/>"><p><i class="fas fa-download"></i><a id="save"> Generar Informe</a></p></td>
An then, in JQuery:
$(document).ready(function() {
$('#informe').tooltip("option","html","true");
$('#informe').tooltip("option","animated","fade");
$('#informe').tooltip("option","placement","bottom");
});
I have a link which on onclick calls a JS function that downloads a PDF. I want that when you put the mouse on the link, it shows a preview (a simple image) of the PDF you're about to generate. I have tried the solutions I've seen in other questions of this page but they don't work.
This is how I dispose the link:
<td colspan="2"><p><i class="fas fa-download"></i><a href="#" id="informe" title="">Generar Informe</a></p></td>
And this is the JQuery:
$('#informe').tooltip({content: "<img src='images/reports/informeInversiones.PNG'/>"});
I've tried even to put simple text in content:
but it doesn't even show a tooltip.