且构网

分享程序员开发的那些事...
且构网 - 分享程序员编程开发的那些事

将工具提示保留在父容器中

更新时间:2022-03-27 22:31:28

您可以使用 position 选项. jQuery UI Position选项包含许多其他选项,例如myat等.一旦此选项为 .这可以用来限制一个元素在另一个元素内的位置.

You can achieve anything related to positioning of tooltip using the position option in the jQuery UI Tooltip. The jQuery UI Position option contain many further options such as my, at etc. Once such option is within. This can be used to limit the position of an element within another.

在这里,只需按如下所示初始化工具提示即可将工具提示位置包含在父元素中.

Here, the tooltips position can be contained within the parent element simply by initializing the tooltip as follows.

$( '#bodyInner' ).tooltip({
    position:{ within: "#bodyInner"}
});

这是演示.