aboutsummaryrefslogtreecommitdiffstats
path: root/demos
diff options
context:
space:
mode:
authorScott González <scott.gonzalez@gmail.com>2012-06-13 05:07:26 -0400
committerScott González <scott.gonzalez@gmail.com>2012-06-13 05:07:26 -0400
commita47f5dc4f21762126ff460af9f49dffeb36e4086 (patch)
tree5fec6d5c8ab313493356ebc6a8bb33cb45a8d623 /demos
parent3d5c6183a3c4f177b747c37dc87579ff41e2305c (diff)
downloadjquery-ui-a47f5dc4f21762126ff460af9f49dffeb36e4086.tar.gz
jquery-ui-a47f5dc4f21762126ff460af9f49dffeb36e4086.zip
Tooltip mouse tracking demo: Only track the mouse when the tooltip is opened on hover. Don't let the positioning of one tooltip affect other tooltips.
Diffstat (limited to 'demos')
-rw-r--r--demos/tooltip/tracking.html11
1 files changed, 7 insertions, 4 deletions
diff --git a/demos/tooltip/tracking.html b/demos/tooltip/tracking.html
index 9f9ce1752..033bc9766 100644
--- a/demos/tooltip/tracking.html
+++ b/demos/tooltip/tracking.html
@@ -23,12 +23,15 @@
my: "left+25 center",
at: "center"
},
- open: function( event ) {
- var tooltip = $( ".ui-tooltip" ),
- positionOption = $( this ).tooltip( "option", "position" );
+ open: function( event, ui ) {
+ if ( !( /^mouse/.test( event.originalEvent.type ) ) ) {
+ return;
+ }
+
+ var positionOption = $.extend( {}, $( this ).tooltip( "option", "position" ) );
function position( event ) {
positionOption.of = event;
- tooltip.position( positionOption );
+ ui.tooltip.position( positionOption );
}
$( document ).bind( "mousemove.tooltip-position", position );
// trigger once to override element-relative positioning