Saturday, May 11, 2024
 Popular · Latest · Hot · Upcoming
60
rated 0 times [  65] [ 5]  / answers: 1 / hits: 66475  / 9 Years ago, mon, april 6, 2015, 12:00:00
<button title=Tooltip on right data-placement=right data-toggle=tooltip class=btn btn-default mrs type=button>Tooltip on right</button>


<script>
$(function () {
$('[data-toggle=tooltip]').tooltip();
});
</script>


This works fine but I'd like to include an image and some text inside the tooltip. I tried to use data-content=some stuff but it shows nothing.


More From » jquery

 Answers
37

You have to pass in the html option to when you initialize .tooltip.
e.g.



<div class=cart> 
<a data-toggle=tooltip title=<img src='http://getbootstrap.com/apple-touch-icon.png' />>
<i class=icon-shopping-cart></i>
</a>




$('a[data-toggle=tooltip]').tooltip({
animated: 'fade',
placement: 'bottom',
html: true
});


See the example fiddle


[#67184] Thursday, April 2, 2015, 9 Years  [reply] [flag answer]
Only authorized users can answer the question. Please sign in first, or register a free account.
hasancolec

Total Points: 603
Total Questions: 95
Total Answers: 98

Location: South Korea
Member since Sat, Oct 2, 2021
3 Years ago
;