jquery-cluetip icon indicating copy to clipboard operation
jquery-cluetip copied to clipboard

Use of delayedClose together with sticky / mouseOutClose

Open AnnaDamm opened this issue 13 years ago • 0 comments

I tried to use options delayedClose together with sticky, as in: close the tooltip after 500ms when not in the tooltip. I don't want to have a close button. My version now looks like this:


if (opts.delayedClose > 0) {
          if (opts.sticky) {
              $this.bind('mouseenter', function() {
                  clearTimeout(closeOnDelay);
              }).bind('mouseleave', function() {
                  clearTimeout(closeOnDelay);
                  closeOnDelay = setTimeout(cluetipClose, opts.delayedClose);
              });
              $cluetip.bind('mouseenter', function() {
                clearTimeout(closeOnDelay);
              });
          } else {
              closeOnDelay = setTimeout(cluetipClose, opts.delayedClose);
          }
      }

There may have to be a check if the option mouseOutClose is set, too.

AnnaDamm avatar May 17 '11 17:05 AnnaDamm