2

I'm using standard facebook style tooltips for jquery. My .js file contains the following:

$(function(){
    $('[rel=tipsy]').tipsy({ fade: true, gravity: 'n' });
});

$(document).on('mousedown touchstart', function(e){
if ($('#header .dropdown:visible').length) {
    var container = $('#header .dropdown:visible');
    if (!container.is(e.target) && container.has(e.target).length === 0)     {
        $('#header .dropdown:visible').stop().slideUp('fast').parent().removeClass('active');
    }
}
});

$(document).on('mouseup touchend', function(e){
if ($('.tipsy:visible').length) {
    var container = $('[rel=tipsy]');
    if (!container.is(e.target) && container.has(e.target).length === 0)     {
        $('[rel=tipsy]').each(function(){
            $(this).tipsy('hide');
        });
    }
}
});

All works fine with mouse clicks. On tablets and smartphones I have a problem with repeated clicks on the element with rel=tipsy. First click on the element shows me a pop-up hint as it should be. Then second click anywhere hides this pop-up hint. When I try again to click on the same element, nothing happens. And this is the problem.

I have one more element on the page with rel=tipsy. After clicking on it and then hiding it my next click on the first element with rel=tipsy works again but again only for the first click on it.

Tell me, please, where is a mistake?

CBroe
  • 91,630
  • 14
  • 92
  • 150
williamzo
  • 7
  • 5
  • I found that for hiding first pop-up "hide: function() {" from "facebook style tooltips for jquery" was called. After that there is absolutely no reaction on repeated clicks. But if to click on the second rel=tipsy element then the same hide: function() is called again. But why? I thought that "show: function() {" should be called when click on it. – williamzo Nov 25 '17 at 22:28

0 Answers0