JQuery tipsy plugin. Focus trigger does not work

I filtered my way through jQuery tooltip plugins and found tipsy ones. It is used by GitHub, which is exactly what I based on most of my solutions. I really like it and it is very easy to use.

I have a problem with this. I need the tooltip to disappear in focus, not freeze. It currently works, but only on hover. Here is my current code:

$('input.tip').tipsy({trigger: 'focus', gravity: 'w', fade: true});

With or without trigger: 'hover',does not matter. I carefully read the documents, so this is the correct code.

This is not related to HTML / CSS, I know this actually. Because it already works, just out of focus.

I am using jQuery v1.4.4.

Any suggestions would be greatly appreciated, thanks.

Resource: http://onehackoranother.com/projects/jquery/tipsy/

+3
source share
3 answers

The plugin works for me in a simple test version based on the code that you provide. Are you sure that there is nothing in the additional code for your page that could lead to an error?

My simple test case draws in a tipsy github plugin. jsfiddle.net adds some additional material, but important bits can be reduced to the following HTML, which works when I test it:

<!DOCTYPE html> 
<html> 
<head> 
  <script type='text/javascript' src='http://code.jquery.com/jquery-1.4.4.min.js'></script> 
  <script type='text/javascript' src="https://github.com/jaz303/tipsy/raw/fa497c144ad7d14126a808f4c18a9ba22f2df70f/src/javascripts/jquery.tipsy.js"></script> 
  <script type='text/javascript'> 
  $(function(){
      $('input.focustip').tipsy({trigger: 'focus', gravity: 'w', fade: true});
      $('input.hovertip').tipsy({trigger: 'hover', gravity: 'w', fade: true});
  });
  </script> 
</head> 
<body> 
  <p>Test case for <a href="http://stackoverflow.com/q/4258519/445073">stackoverflow question</a>.</p> 
<p>Focus tip: <input class="focustip" title="focus"></input></p> 
<p>Hover tip: <input class="hovertip" title="hover"></input></p> 
</body> 
</html> 

I tested in Firefox 3.6 and Chrome 8, both on Linux.

+2
source

. CSS- Blueprint. , - , : 1.0.0a GitHub, (), 0.1.7.

Dayy Tipsy v0.1.7 .

.

+1

You probably did not enter a TITLE for the tag.

0
source

Source: https://habr.com/ru/post/1776504/


All Articles