开发者

jquery tooltip IE problem

I am using jquery tooltip in area which is reloaded with ajax. So I bind the js for tooltip and all work fine for most browser but not for IE 7 and 8. There is a problem with position and it give me error like "left is NULL or not an 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开发者_StackOverflow.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 error popup if I move mouse quickly to that area it start working normal. Can someone say what`s the problem. The reloaded area is with fixed width.


Did you also use the optional plugin? http://plugins.jquery.com/project/bgiframe


$(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}); })
    });
});

Here you can see how it works: http://jsfiddle.net/au4Lt/

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜