1

tipsy is great jQuery tooltip plugin like facebook. This worked with many option but I print link of mypage in tooltip (rel method) now I need to if user click in my link show tooltip and user copy link of my current page ( I put in tooltip) tooltip, if user click in page body or outside tooltip/ hidden tooltip hide. In tipsy documents(Manual triggering example) only trigger link with show/hide link ( 2 link ) if we change this to 1 link ( toogle / click show/ click hide) OR change click in body/outside i think my problem is fix. any way to this solution/problem ? Thanks

Tipsy for trigger :

<div class='caption'>Manual triggering example:</div>
<div id='manual-example' class='example'>
<a rel='tipsy' title='Well hello there'>My tooltip is manually triggered</a> |
<a href='#' onclick='$("#manual-example a[rel=tipsy]").tipsy("show"); return false;'>Show it</a> |
<a href='#' onclick='$("#manual-example a[rel=tipsy]").tipsy("hide"); return false;'>Hide it</a>
</div>
Shikiryu
  • 10,180
  • 8
  • 49
  • 75
BBKing
  • 2,279
  • 8
  • 38
  • 44

1 Answers1

1

You can use this code to toggle between states :

var el = $('#manual-example a[rel=tipsy]').tipsy({trigger: 'manual'});
$('#toggleIt').click(function(e){
    e.preventDefault();
    if($('.tipsy').length == 0){
        el.tipsy('show');
    }else{
        el.tipsy('hide');        
    }
});

JSFIDDLE

Shikiryu
  • 10,180
  • 8
  • 49
  • 75