设置tooltip的位置:position
匿名 · 更新于 2014/3/27
position(位置)
Default(默认值):{ my: "left top+15", at: "left bottom", collision: "flipfit" }Identifies the position of the tooltip in relation to the associated target element. The
of option defaults to the target element, but you can specify another element to position against. You can refer to the jQuery UI Position utility for more details about the various options.确定就相关目标元素的工具提示的位置。该选项默认为目标元素,但您可以指定其他元素所面对的市场。你可以参考jQuery UI的位置实用程序,用于对各种选项的更多细节。
Code examples(代码示例):
Initialize the tooltip with the position option specified(初始化工具提示使用指定的位置的选项):
$( ".selector" ).tooltip({ position: { my: "left+15 center", at: "right center" } });
Get or set the position option, after initialization(获取或设置位置的选项,初始化后):
// getter var position = $( ".selector" ).tooltip( "option", "position" );// setter $( ".selector" ).tooltip( "option", "position", { my: "left+15 center", at: "right center" } );
