我目前正在使用 jquery ui 工具提示并使用 track:true
选项。它工作得很好,但是我不希望工具提示在垂直移动时仅水平移动时跟踪鼠标
有什么想法吗?
$(function () {
$(document).tooltip({
items: ".entry",
position: {
my: "right bottom+50"
},
track: true,
content: function () {
return "<div class='hi'>This is a very nice entry! It's so pretty and I feel like I can touch it. This is just random filler text.</div>";
}
});})
最佳答案
我将 tooltipClass
属性添加到工具提示中,如下所示:
$(document).tooltip({
...
tooltipClass: "tooltip-position",
});
并添加了以下 CSS 以防止工具提示在垂直滚动时移动:
.tooltip-position {
top: 200px !important;
}
参见here对于 fiddle
关于jquery-ui - 如何使用轨道:true?使工具提示仅水平跟踪鼠标,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/22660503/