2
I have a code that generates a tooltip with a small message and makes disappear after 2.5s.
var msg ="Oops! Essa é uma mensagem pequena";
$('#addItInfo').attr('data-original-title',msg);
$('#addItInfo').tooltip('show');
setTimeout( function(){
$('#addItInfo').tooltip('hide');
$('#addItInfo').removeAttr('title');
$('#addItInfo').removeAttr('data-original-title');
} , 2500 ); //Wait 2,5 seconds
The code works well, however I would like to dynamically insert some HTML elements inside this tooltip, so I can bring some database information when the user hovers the mouse on the element that contains the tooltip. I took a test with a div and so I created this message just for test:
var msg ="Essa é uma mensagem teste <div>elemento div interno</div>";
Unfortunately the tooltip element does not display as expected.
Here is a small example of how I would like it. In this example I inserted a table inside the tooltip that is not bootstrap (only to test if it is possible) and that it is not well formatted (has other problems).
So my question is: how to insert html elements inside a bootstrap tootip? Any ideas?
popover
would be more appropriate for what you want. Just activate it at Hover.trigger: 'hover'
– dap.tci
Yes Dap.Tci, I was really looking for another way to present this data and Popover seems to be what I was looking for. I will do my tests with the tooltip, but I will be really [and with the Popover. Thanks!
– zwitterion