Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

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>
like image 983
Vishnu Bhadoriya Avatar asked Aug 23 '16 11:08

Vishnu Bhadoriya


People also ask

What is Bootstrap tooltip?

Bootstrap Tooltip displays informative text when users hover, focus, or tap an element. They display text tips next to the element in question. Documentation and examples for adding custom tooltips with CSS and JavaScript using CSS3 for animations and data-mdb-attributes for local title storage.

Do I need to include Popper before or after bootstrap?

You must include popper.min.js before bootstrap.js in order for tooltips to work! Tooltips are opt-in for performance reasons, so you must initialize them yourself.

How to enable tooltip on disabled-buttons?

It means users cannot focus, hover, or click them to trigger a tooltip (or popover) or any functions. Use the following approaches to enable a tooltip on disabled-buttons. By default tooltips is initialized by selecting the specified element and call the tooltip () method using jQuery.

How do I trigger a tooltip?

Tooltips can be triggered thanks to an element inside a shadow DOM. Hover over the buttons below to see the four tooltips directions: top, right, bottom, and left. Elements with the disabled attribute aren’t interactive, meaning users cannot focus, hover, or click them to trigger a tooltip (or popover).


1 Answers

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

like image 100
Alan Jurczak Avatar answered Nov 09 '22 11:11

Alan Jurczak