$('#nav a[href][title]').qtip({
content: {
text: false // Use each elements title attribute
},
position: {
corner: {
target: 'topLeft',
tooltip: 'middleRight'
}
},
style: {
name: 'dark',
width: 230,
padding: 3,
bottom: 10,
textAlign: 'center'
}
// Give it some style
});
我想模拟:css: position:relative;bottom:10px 以便工具提示与目标垂直对齐(见图片),但我无法完成
这样尝试
$('#nav a[href][title]').qtip({
content: {
text: false // Use each elements title attribute
},
position: {
corner: {
target: 'topLeft',
tooltip: 'middleRight'
}
},
style: {
name: 'dark',
width: 230,
padding: 3,
position: 'relative',
bottom: 10,
textAlign: 'center'
}
// Give it some style
});
但是工具提示的文本被移动,而不是工具提示本身,
我该怎么做?
编辑
尝试“调整”属性,但我找不到语法错误
$('#nav a[href][title]').qtip({
content: {
text: false // Use each elements title attribute
},
position: {
adjust: {
x: 10px,
y: 10px
},
corner: {
target: 'topLeft',
tooltip: 'middleRight'
}
},
style: {
name: 'dark',
width: 230,
padding: 3,
textAlign: 'center'
},
// Give it some style
});
最佳答案
您可以使用“position”属性组的“adjust”属性,如下所示:
position: {
corner: {
target: 'topLeft',
tooltip: 'middleRight'
},
adjust: {
x: 10,
y: 10
}
}
我提供的数字是任意的。您可以随心所欲地摆弄它们。
关于jquery - 在 qtip 工具提示上手动定位调整(不工作),我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/6002967/