qTip2里面的iframe检测mouseenter&mousemove
问题描述:
我有一个动态加载的iframe。我希望qtips在用户将鼠标悬停在某些元素上时显示,并且qtips将在元素内一次跟随光标。我无法使用选项target: 'mouse'
,因为iframe中的qtips固定位于父容器。我得到了一些有用的东西,除了提示仍然离开我的光标,只在y轴上,在FF中,距离最远,IE最接近。我知道这不是实现它的正确方式,所以任何帮助表示赞赏。谢谢!qTip2里面的iframe检测mouseenter&mousemove
$("#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'
});
});
});
});
我设法通过使用'target:[e.clientX,e.clientY]来解决*的问题'但我还是想知道mouseenter和mousemove是否会影响性能...... –