<script>
$(function() {
$( ".demo" ).tooltip({
+ position: {
+ my: "left+25 center",
+ at: "center"
+ },
open: function( event ) {
- var tooltip = $( ".ui-tooltip" );
+ var tooltip = $( ".ui-tooltip" ),
+ positionOption = $( this ).tooltip( "option", "position" );
function position( event ) {
- tooltip.position({
- my: "left+25 center",
- at: "right+25 center",
- of: event
- });
+ positionOption.of = event;
+ tooltip.position( positionOption );
}
$( document ).bind( "mousemove.tooltip-position", position );
// trigger once to override element-relative positioning