jQuery:设置工具提示位置一次,但不带";激活";这是一份完整的文件
我使用: 它可以工作,但是对于我不需要工具提示的元素,也会显示工具提示 我知道我可以用jQuery:设置工具提示位置一次,但不带";激活";这是一份完整的文件,jquery,position,tooltip,Jquery,Position,Tooltip,我使用: 它可以工作,但是对于我不需要工具提示的元素,也会显示工具提示 我知道我可以用 $(document).tooltip({ position: { my: 'left center', at: 'right+60 center' } }); 但是否可以只设置一次位置 编辑 我试过了 $("textarea[name=thename]").tooltip(
$(document).tooltip({
position: {
my: 'left center',
at: 'right+60 center'
}
});
但是否可以只设置一次位置
编辑
我试过了
$("textarea[name=thename]").tooltip();
$("textarea[name=thename2]").tooltip();
....
$("input[name=name3]").tooltip();
但是没有什么我能想到的最好办法是在变量中指定一个位置:
$.tooltip({
position: {
my: 'left center',
at: 'right+60 center'
}
});
然后在以后使用它:
var myPos = { my: 'left center', at: 'right+60 center' };
在$(文档)
上使用它会将其附加到整个文档及其子体,这就是无论鼠标指向何处,它都会出现的原因
$("textarea[name=thename]").tooltip({position: myPos});
$("textarea[name=thename2]").tooltip({position: myPos);