diff options
Diffstat (limited to 'demos')
-rw-r--r-- | demos/tooltip/tracking.html | 11 |
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 |