mirror of
https://github.com/jquery/jquery-ui.git
synced 2024-11-21 11:04:24 +00:00
Tooltip: Overhaul widget animations code to allow delay with plain show/hide
This commit is contained in:
parent
3bb9ab2626
commit
a03c222f05
@ -17,8 +17,8 @@
|
|||||||
delay: 250
|
delay: 250
|
||||||
},
|
},
|
||||||
hide: {
|
hide: {
|
||||||
effect: "slideUp",
|
effect: "hide",
|
||||||
delay: 500
|
delay: 250
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
@ -47,7 +47,9 @@
|
|||||||
|
|
||||||
<div class="demo-description">
|
<div class="demo-description">
|
||||||
|
|
||||||
<p>Here the tooltips are positioned relative to the mouse, and follow the mouse while it moves above the element.</p>
|
<p>This demo shows how to customize animations. The tooltip is shown, after a
|
||||||
|
delay of 250ms, using a slide down animation, and hidden, after another delay,
|
||||||
|
without an animation.</p>
|
||||||
|
|
||||||
</div><!-- End demo-description -->
|
</div><!-- End demo-description -->
|
||||||
|
|
||||||
|
17
ui/jquery.ui.widget.js
vendored
17
ui/jquery.ui.widget.js
vendored
@ -365,12 +365,23 @@ $.each( { show: "fadeIn", hide: "fadeOut" }, function( method, defaultEffect ) {
|
|||||||
if ( hasOptions && $.effects && $.effects[ effectName ] ) {
|
if ( hasOptions && $.effects && $.effects[ effectName ] ) {
|
||||||
element[ method ]( options );
|
element[ method ]( options );
|
||||||
} else if ( element[ effectName ] ) {
|
} else if ( element[ effectName ] ) {
|
||||||
element[ effectName ]( options.duration, options.easing, callback );
|
if ( /show|hide/.test( effectName ) ) {
|
||||||
} else {
|
element.queue( function() {
|
||||||
element[ method ]();
|
element[ effectName ]();
|
||||||
if ( callback ) {
|
if ( callback ) {
|
||||||
callback.call( element[ 0 ] );
|
callback.call( element[ 0 ] );
|
||||||
}
|
}
|
||||||
|
});
|
||||||
|
} else {
|
||||||
|
element[ effectName ]( options.duration, options.easing, callback );
|
||||||
|
}
|
||||||
|
} else {
|
||||||
|
element.queue( function() {
|
||||||
|
$( this )[ method ]();
|
||||||
|
if ( callback ) {
|
||||||
|
callback.call( element[ 0 ] );
|
||||||
|
}
|
||||||
|
});
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
});
|
});
|
||||||
|
Loading…
Reference in New Issue
Block a user