Strange error in jQuery 1.4
in Using jQuery
•
13 years ago
Morning peoples.
I keep getting the following error when i am working with some positioning in jquery
Permission denied to access property 'nodeType' from a non-chrome context
The code is below that triggers the error...
Basically the code listens for a mousenter event on a target area and shows an element behind it then inside that element are other elements that have mouseenter bound in live() to show a tooltip.
var element=$(this);
var rand=$(this).find('.rand').val();
var text=$("#stacked-tooltip-"+rand+"").html();
var height=element.outerHeight();
var left=Math.round(element.offset().left);
var top=Math.round((element.offset().top - ( height / 2 ) ));
$("<div/>",{
id: 'tooltip-'+rand,
'class': 'dock-tooltip',
css :
{
'position': 'absolute',
'z-index': 999,
'left': left+'px',
'top': top+'px',
'display': 'none'
},
html : text
}).appendTo("#container").show("fast");
});
$(".stacked-window").live("mouseleave", function(){
var element=$(this);
var rand=$(this).find('.rand').val();
$("#tooltip-"+rand+"").remove();
});
$("#dock").fadeIn("fast");
});
$("#dock-hover").mouseleave(function(){
$("#dock").fadeOut(400);
});
The error does not happen all the time - only when i seem to mouseleave the tooltip element quickly and the hover element...
Has anyone every encountered a problem like this or is it a known bug ?
Thanks in advance
/Alex
5