Skip to content

Commit a3d5a40

Browse files
committed
with 'not to hide on tip over' feature, I added the ability of delaying in show/hide the tip. options.delayOut is by default zero. no need to add <a></a>, let it original
1 parent 2f1f95f commit a3d5a40

File tree

1 file changed

+9
-10
lines changed

1 file changed

+9
-10
lines changed

src/javascripts/jquery.tipsy.js

+9-10
Original file line numberDiff line numberDiff line change
@@ -21,10 +21,7 @@
2121
var title = this.getTitle();
2222
if (title && this.enabled) {
2323
var $tip = this.tip();
24-
var $link = $tip.find('.tipsy-inner > a');
25-
26-
$link.attr('href', this.$element.attr('href'));
27-
$link[this.options.html ? 'html' : 'text'](title);
24+
$tip.find('.tipsy-inner')[this.options.html ? 'html' : 'text'](title);
2825

2926
$tip[0].className = 'tipsy'; // reset classname in case of dynamic gravity
3027
$tip.remove().css({top: 0, left: 0, visibility: 'hidden', display: 'block'}).prependTo(document.body);
@@ -165,22 +162,24 @@
165162
tipsy.hide();
166163
} else {
167164
}
168-
}, options.delayOut || 0);
165+
}, options.delayOut);
169166
}
170167

171168
function enterTarget() {
172169
var tipsy = get(this);
173170
tipsy.mouseInsideTarget = true;
174-
175171
if (options.delayIn == 0) {
176172
show(tipsy);
173+
tipsy.$tip.unbind('mouseenter mouseleave');
174+
tipsy.$tip.hover(function() { enterTipsy.call(tipsy); }, function() { leaveTipsy.call(tipsy); });
177175
} else {
178176
tipsy.fixTitle();
179-
setTimeout(function() { show(tipsy); }, options.delayIn);
177+
setTimeout(function() {
178+
show(tipsy);
179+
tipsy.$tip.unbind('mouseenter mouseleave');
180+
tipsy.$tip.hover(function() { enterTipsy.call(tipsy); }, function() { leaveTipsy.call(tipsy); });
181+
}, options.delayIn);
180182
}
181-
182-
tipsy.$tip.unbind('mouseenter mouseleave');
183-
tipsy.$tip.hover(function() { enterTipsy.call(tipsy); }, function() { leaveTipsy.call(tipsy); });
184183
}
185184

186185
function leaveTarget() {

0 commit comments

Comments
 (0)