diff --git a/demos/tooltip/custom-animation.html b/demos/tooltip/custom-animation.html
index 23fa9aefe7..b8f012d916 100644
--- a/demos/tooltip/custom-animation.html
+++ b/demos/tooltip/custom-animation.html
@@ -9,25 +9,35 @@
+
+
-
@@ -35,14 +45,10 @@
-
Tooltips can be attached to any element. When you hover
-the element with your mouse, the title attribute is displayed in a little box next to the element, just like a native tooltip.
-
But as it's not a native tooltip, it can be styled. Any themes built with
-ThemeRoller
-will also style tooltips accordingly.
-
Tooltips are also useful for form elements, to show some additional information in the context of each field.
-
Your age:
-
Hover the field to see the tooltip.
+
There are various ways to customize the animation of a tooltip.
+
You can use the show and
+hide options.
+
You can also use the position option .
diff --git a/ui/jquery.ui.tooltip.js b/ui/jquery.ui.tooltip.js
index b781174c92..c0aaa4fbea 100644
--- a/ui/jquery.ui.tooltip.js
+++ b/ui/jquery.ui.tooltip.js
@@ -90,11 +90,16 @@ $.widget("ui.tooltip", {
target.attr( "aria-describedby", tooltip.attr( "id" ) );
}
tooltip.find( ".ui-tooltip-content" ).html( content );
- tooltip.position( $.extend({
- of: target
- }, this.options.position ) ).hide();
+ tooltip
+ .stop( true )
+ .position( $.extend({
+ of: target,
+ using: function( pos ) {
+ // we only want to hide if there's no custom using defined
+ $( this ).css( pos ).hide();
+ }
+ }, this.options.position ) );
- tooltip.stop( true );
this._show( tooltip, this.options.show );
this._trigger( "open", event );
diff --git a/ui/jquery.ui.widget.js b/ui/jquery.ui.widget.js
index 4167fd4e57..3bf735cd3a 100644
--- a/ui/jquery.ui.widget.js
+++ b/ui/jquery.ui.widget.js
@@ -379,7 +379,7 @@ $.each( { show: "fadeIn", hide: "fadeOut" }, function( method, defaultEffect ) {
var hasOptions = !$.isEmptyObject( options ),
effectName = options.effect || defaultEffect;
options.complete = callback;
- if (options.delay) {
+ if ( options.delay ) {
element.delay( options.delay );
}
if ( hasOptions && $.effects && ( $.effects.effect[ effectName ] || $.uiBackCompat !== false && $.effects[ effectName ] ) ) {