javascripttooltipster

Tooltipster .tooltipster('open') throwing error.


I am having problem with Tooltipster. Can't figure out why 'open' is not working, while according to documentation it should?

I have setup it on jsfiddle

HTML

<button id="broken" title="Broken Tooltip">Broken</button>

JS:

  $('#broken').on('click', function(e) {
    $('#broken').tooltipster('open');
  });

But it throws error:

Uncaught Error: Unknown method .tooltipster("open")
<...?

Replacing 'open' with 'destroy' for example works fine.

Anyone can figure out what I am doing wrong? Or broken tooltipster itself?


Solution

  • There is trigger:'click' in tooltipster

    $(document).ready(function() {
      $('#search').tooltipster({
    
      });
    
      $('#broken').tooltipster({
        trigger: 'click'
      });
    
    
    });
    <script src="https://ajax.googleapis.com/ajax/libs/jquery/2.1.1/jquery.min.js"></script>
    <link href="https://cdnjs.cloudflare.com/ajax/libs/tooltipster/3.3.0/css/tooltipster.min.css" rel="stylesheet"/>
    <script src="https://cdnjs.cloudflare.com/ajax/libs/tooltipster/3.3.0/js/jquery.tooltipster.min.js"></script>
    <button id="search" title="Tooltip Working">Search</button>
    
    <button id="broken" title="Broken Tooltip">Broken</button>