Skip to content
Permalink
Browse files

Tooltip: Add support for delaying showing/hiding. Still need to figure

out how to combine that with non-animated show/hide.
  • Loading branch information
jzaefferer committed Apr 21, 2011
1 parent 3950a05 commit 3bb9ab262670328de9eb9a97892e9cf85c55c7d9
Showing with 9 additions and 5 deletions.
  1. +4 −2 demos/tooltip/custom-animation.html
  2. +2 −2 ui/jquery.ui.tooltip.js
  3. +3 −1 ui/jquery.ui.widget.js
@@ -13,10 +13,12 @@
$(function() {
$(".demo").tooltip({
show: {
effect: "slideDown"
effect: "slideDown",
delay: 250
},
hide: {
effect: "slideUp"
effect: "slideUp",
delay: 500
}
});
});
@@ -90,7 +90,7 @@ $.widget("ui.tooltip", {
of: target
}, this.options.position ) ).hide();


tooltip.stop( true );
this._show( tooltip, this.options.show );

this._trigger( "open", event );
@@ -111,7 +111,7 @@ $.widget("ui.tooltip", {
var tooltip = this._find( target );
target.removeAttr( "aria-describedby" );

tooltip.stop();
tooltip.stop( true );
this._hide( tooltip, this.options.hide, function() {
$( this ).remove();
});
@@ -359,7 +359,9 @@ $.each( { show: "fadeIn", hide: "fadeOut" }, function( method, defaultEffect ) {
var hasOptions = !$.isEmptyObject( options ),
effectName = options.effect || defaultEffect;
options.complete = callback;

if (options.delay) {
element.delay( options.delay );
}
if ( hasOptions && $.effects && $.effects[ effectName ] ) {
element[ method ]( options );
} else if ( element[ effectName ] ) {

0 comments on commit 3bb9ab2

Please sign in to comment.
You can’t perform that action at this time.