admin管理员组文章数量:1420907
A third party jQuery tooltip is jQuery Tools Tooltips: ToolTips Done Right. Can it be breaking just by having an outer div with position: relative
?
This one works: .html
Just adding a position: relative
to the outer div (the one with blue border), and the tooltip gets massively misplaced (by whatever amount the header div pushes down): .html
The quality of 3rd party open-source code.
Does any jQuery guru have a fix quickly? The requirement is that the outer div must have position: relative
or position: absolute
for one reason or another. I think the reason it is breaking is that jQuery Tools Tooltip uses position: absolute
to position the tooltip, but without knowing that the absolute
is actually relative to the "nearest ancestor that is positioned", as the CSS spec says. So it breaks, by just a simple case.
A third party jQuery tooltip is jQuery Tools Tooltips: ToolTips Done Right. Can it be breaking just by having an outer div with position: relative
?
This one works: http://www.topics2look./code-examples/jquery-tools-tooltip-bug/this-works.html
Just adding a position: relative
to the outer div (the one with blue border), and the tooltip gets massively misplaced (by whatever amount the header div pushes down): http://www.topics2look./code-examples/jquery-tools-tooltip-bug/with-relative-position-it-does-not-work.html
The quality of 3rd party open-source code.
Does any jQuery guru have a fix quickly? The requirement is that the outer div must have position: relative
or position: absolute
for one reason or another. I think the reason it is breaking is that jQuery Tools Tooltip uses position: absolute
to position the tooltip, but without knowing that the absolute
is actually relative to the "nearest ancestor that is positioned", as the CSS spec says. So it breaks, by just a simple case.
1 Answer
Reset to default 7Try using the relative
property (third from the bottom).
$('#main-content').tooltip({
bounce: false,
relative: true, // <-- Adding this should sort you out
slideOffset: 5,
effect: 'slide',
direction: 'down',
slideInSpeed: 300,
slideOutSpeed: 200,
position: 'bottom center'
});
本文标签:
版权声明:本文标题:javascript - jQuery Tools Tooltips does not work simply by an outer div having position: relative? - Stack Overflow 内容由网友自发贡献,该文观点仅代表作者本人, 转载请联系作者并注明出处:http://www.betaflare.com/web/1745344740a2654426.html, 本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌抄袭侵权/违法违规的内容,一经查实,本站将立刻删除。
发表评论