mirror of
https://github.com/jquery/jquery-ui.git
synced 2024-10-05 01:44:18 +00:00
Custom tooltip animations based on widget-animations branch.
This commit is contained in:
parent
00559b388a
commit
e609bebaae
@ -11,15 +11,12 @@
|
|||||||
<link type="text/css" href="../demos.css" rel="stylesheet" />
|
<link type="text/css" href="../demos.css" rel="stylesheet" />
|
||||||
<script type="text/javascript">
|
<script type="text/javascript">
|
||||||
$(function() {
|
$(function() {
|
||||||
// TODO overhaul this with custom animation API
|
|
||||||
$(".demo").tooltip({
|
$(".demo").tooltip({
|
||||||
open: function() {
|
show: {
|
||||||
$(".ui-tooltip").stop(false, true).hide().slideDown();
|
effect: "slideDown"
|
||||||
},
|
},
|
||||||
close: function() {
|
hide: {
|
||||||
$(".ui-tooltip").stop(false, false).show().slideUp(function() {
|
effect: "slideUp"
|
||||||
$(this).remove();
|
|
||||||
});
|
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
|
4
ui/jquery.ui.tooltip.js
vendored
4
ui/jquery.ui.tooltip.js
vendored
@ -91,7 +91,7 @@ $.widget("ui.tooltip", {
|
|||||||
}, this.options.position ) ).hide();
|
}, this.options.position ) ).hide();
|
||||||
|
|
||||||
|
|
||||||
tooltip.fadeIn();
|
this._show( tooltip, this.options.show );
|
||||||
|
|
||||||
this._trigger( "open", event );
|
this._trigger( "open", event );
|
||||||
|
|
||||||
@ -111,7 +111,7 @@ $.widget("ui.tooltip", {
|
|||||||
var tooltip = this._find( target );
|
var tooltip = this._find( target );
|
||||||
target.removeAttr( "aria-describedby" );
|
target.removeAttr( "aria-describedby" );
|
||||||
|
|
||||||
tooltip.fadeOut( function() {
|
this._hide( tooltip, this.options.hide, function() {
|
||||||
$( this ).remove();
|
$( this ).remove();
|
||||||
});
|
});
|
||||||
|
|
||||||
|
20
ui/jquery.ui.widget.js
vendored
20
ui/jquery.ui.widget.js
vendored
@ -353,6 +353,26 @@ $.Widget.prototype = {
|
|||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
|
$.each( { show: "fadeIn", hide: "fadeOut" }, function( method, defaultEffect ) {
|
||||||
|
$.Widget.prototype[ "_" + method ] = function( element, options, callback ) {
|
||||||
|
options = options || {};
|
||||||
|
var hasOptions = !$.isEmptyObject( options ),
|
||||||
|
effectName = options.effect || defaultEffect;
|
||||||
|
options.complete = callback;
|
||||||
|
|
||||||
|
if ( hasOptions && $.effects && $.effects[ effectName ] ) {
|
||||||
|
element[ method ]( options );
|
||||||
|
} else if ( element[ effectName ] ) {
|
||||||
|
element[ effectName ]( options.duration, options.easing, callback );
|
||||||
|
} else {
|
||||||
|
element[ method ]();
|
||||||
|
if ( callback ) {
|
||||||
|
callback.call( element[ 0 ] );
|
||||||
|
}
|
||||||
|
}
|
||||||
|
};
|
||||||
|
});
|
||||||
|
|
||||||
// DEPRECATED
|
// DEPRECATED
|
||||||
if ( $.uiBackCompat !== false ) {
|
if ( $.uiBackCompat !== false ) {
|
||||||
$.Widget.prototype._getCreateOptions = function() {
|
$.Widget.prototype._getCreateOptions = function() {
|
||||||
|
Loading…
Reference in New Issue
Block a user