Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP

Loading…

Add interactive tooltip support #97

Open
wants to merge 1 commit into from

2 participants

@jisaacks

When setting the interactive option to true you can interact with the toolip, if you want to have links or other elements in the tooltip.
Note: You must also set a delayOut for this to work.

@jisaacks jisaacks Add interactive tooltip support
When setting the interactive option to true you can interact with the toolip, if you want to have links or other elements in the tooltip.
Note: You must also set a delayOut for this to work.
ebb4070
@teawaterwire

Will this be integrated into the library any time soon?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Commits on Mar 17, 2012
  1. @jisaacks

    Add interactive tooltip support

    jisaacks authored
    When setting the interactive option to true you can interact with the toolip, if you want to have links or other elements in the tooltip.
    Note: You must also set a delayOut for this to work.
This page is out of date. Refresh to see the latest.
Showing with 18 additions and 2 deletions.
  1. +18 −2 src/javascripts/jquery.tipsy.js
View
20 src/javascripts/jquery.tipsy.js
@@ -159,7 +159,22 @@
if (options.delayOut == 0) {
tipsy.hide();
} else {
- setTimeout(function() { if (tipsy.hoverState == 'out') tipsy.hide(); }, options.delayOut);
+ var hideTimer = setTimeout(function() { if (tipsy.hoverState == 'out') tipsy.hide(); }, options.delayOut);
+ if(options.interactive) {
+ var $tip = tipsy.tip()
+ $tip.hover(
+ function(){
+ clearTimeout(hideTimer)
+ },
+ function(){
+ hideTimer = setTimeout(function() {
+ if (tipsy.hoverState == 'out') {
+ tipsy.hide()
+ }
+ }, options.delayOut)
+ }
+ );
+ }
}
};
@@ -188,7 +203,8 @@
offset: 0,
opacity: 0.8,
title: 'title',
- trigger: 'hover'
+ trigger: 'hover',
+ interactive: false
};
// Overwrite this method to provide options on a per-element basis.
Something went wrong with that request. Please try again.