1

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?

lapkritinis
  • 2,664
  • 4
  • 19
  • 29

2 Answers2

1

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>
Just code
  • 13,553
  • 10
  • 51
  • 93
  • Working workaround. Would serve my intended purpose if I add timeout to hide message. However still interested why 'open' doesn't work. – lapkritinis Oct 04 '18 at 12:46
  • @lapkritinis I think you are correct, I saw you opened new ticket in repo, here is the link for feature ones. https://github.com/iamceege/tooltipster/issues/751 – Just code Oct 04 '18 at 13:06
  • @lapkritinis I think it is deprecated in latest version, here is the working version http://jsfiddle.net/m9she00L/2/ – Just code Oct 04 '18 at 13:09
  • Actually library version on cdnjs.com is old (3.3.0 which is not working 'open' and which I am using vs 4.2.6 on github). There is some issue ongoing to pull latest version to cdnjs https://github.com/cdnjs/cdnjs/pull/12239 – lapkritinis Oct 04 '18 at 13:34
1

try to trigger: 'click' example http://jsfiddle.net/9gj8c57w/3/

$(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>
<script src="https://cdnjs.cloudflare.com/ajax/libs/tooltipster/3.3.0/js/jquery.tooltipster.min.js"></script>
<link href="https://cdnjs.cloudflare.com/ajax/libs/tooltipster/3.3.0/css/tooltipster.min.css" rel="stylesheet"/>



<button id="search" title="Tooltip Working">Search</button>

<button id="broken" title="Broken Tooltip">Broken</button>
qiAlex
  • 4,290
  • 2
  • 19
  • 35