skip to Main Content
<a href="#" title="Twitter bootstrap" data-toggle="tooltip">bootstrap</a>

i want to show a tooltip without put the cursor.
is there any special attributes to do this?

2

Answers


  1. In general you can show the tooltip from javascript code using $('#my-tooltip').tooltip('show').
    Your anchor tag would have to match the selector and you need to add data-trigger="manual" attribute

    <a id="my-tooltip" href="#" title="Twitter bootstrap" data-toggle="tooltip" data-trigger="manual">bootstrap</a>
    
    Login or Signup to reply.
  2. Per the Bootstrap docs, you can manually show and hide tooltips with the corresponding methods. Not sure what your js looks like, but something like this should work:

    $(document).ready(function () {
      $('#tt-element').tooltip('show')
      setTimeout(function () {
        $('#tt-element').tooltip('hide')
      }, 5000)
    }
    

    Of course, you need to change your html to include id="tt-element"

    Login or Signup to reply.
Please signup or login to give your own answer.
Back To Top
Search