IE IE jQuery Problem

I am using jquery tooltip in an area that reloads using ajax. So I bind js for a tooltip, and everything works fine for most browsers, but not for IE 7 and 8. The problem is with the position and it gives me an error, for example, "left is NULL or not a object", and here is the problematic part of the script `

    var left = helper.parent[0].offsetLeft;
    var top = helper.parent[0].offsetTop;
    if (event) {
        // position the helper 15 pixel to bottom right, starting from mouse position
        left = event.pageX + settings(current).left;
        top = event.pageY + settings(current).top;
        var right='auto';
        if (settings(current).positionLeft) {
            right = $(window).width() - left;
            left = 'auto';
        }
        helper.parent.css({
            left: left,
            right: right,
            top: top
        });
    }`

when I close the error popup, if I quickly move the mouse to this area, it starts working fine. Can someone tell me what the problem is. The reserved area has a fixed width.

+5
source share
2 answers
$(document).ready(function(){
    $('body').append('<div id="tooltip"></div>');
    $('[tooltip]').each(function(){
        $(this)
            .mouseover(function(){ $("#tooltip").css("display","block").html($(this).attr("tooltip")); })
            .mouseout(function(){ $("#tooltip").css("display","none"); })
            .mousemove(function(e){ $("#tooltip").css({"left": e.pageX, "top": e.pageY}); })
    });
});

, : http://jsfiddle.net/au4Lt/

0