qTip2 inside iframe detect mouseenter & mousemove
I have a dynamically loaded iframe. I want the qtips to show when the user hover over certain elements and the qtips will follow the cursor once inside the element. I can't use the option target: 'mouse'
because qtips inside iframe are fixed positioned to the parent container. I got something that kinda work except the tips are still displaced from my cursor, only in the y axis, where in FF the distance is furthest and IE being the closest. I know this is not the right way to implement it, so any help is appreciated. Thanks!
$("#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 开发者_JAVA百科content',
style: 'ui-tooltip-shadow ui-tooltip-rounded'
});
});
});
});
Craig answered this question on the qTip2 forum. Turns out it's the best if you can create the tips within the iframe.
精彩评论