Vishnu Bhadoriya Vishnu Bhadoriya - 3 months ago 35
jQuery Question

How to keep active bootstrap tooltip without hover or click

This is example which i am using for keep open tooltip without hover or click
but its not working any other suggestion


<a href="#" title="Download Excel" class="tool_tip">Download Excel</a>


my jquery for tooltip keep active

<script>
$('.tool_tip').tooltip({trigger: 'manual'}).tooltip('show');
</script>

Answer

Try adding

data-toggle="tooltip" data-placement="right"

to your html:

 <a href="#" data-toggle="tooltip" data-placement="right" title="Download Excel" class="tool_tip">Download Excel</a>

https://jsfiddle.net/404c3fxb/

Or, you can do it with jQuery, for all the elements you want to, with a class selector:

$('.tool_tip')
  .attr('data-toggle', 'tooltip')
  .attr('data-placement', 'right')
  .tooltip({
    trigger: 'manual'
  })
  .tooltip('show');

https://jsfiddle.net/404c3fxb/1/

Where data-placement is the tooltip location (left, top, bottom or right).

Bootstrap tooltip