我有一个动态加载的 iframe。我希望当用户将鼠标悬停在某些元素上时显示 qtips,并且一旦进入元素,qtips 将跟随光标。我不能使用该选项target: 'mouse'
,因为 iframe 内的 qtips 固定定位到父容器。我得到了一些有用的东西,除了提示仍然从我的光标移位,仅在 y 轴上,在 FF 中距离最远,IE 是最近的。我知道这不是实现它的正确方法,因此不胜感激。谢谢!
$("#pageFrame").load(function() {
var pageFrameContent = $(this).contents()[0];
$("div.extra", pageFrameContent)
.mouseenter(function(){
$(this).mousemove(function(e){
$(this).qtip({
position: {
target: [e.screenX,e.screenY]
},
show: {
solo: true,
ready: true,
delay: 0
},
hide:{
event: 'click mouseleave'
},
content: 'Tips content',
style: 'ui-tooltip-shadow ui-tooltip-rounded'
});
});
});
});