views:

226

answers:

2

Hi, I am trying to show a tooltip in a mouseover event. The reason I am creating the tooltip on the fly rather than as a precursor (i.e. creating the qtip in document.ready) is that I have generated a list of items that map to a list of objects and I store the hash key for each object in the object list in a hidden element in the "li", so I grab that every time there is a mouseover on an li element.

What is important though is that I can't seem to get the tooltip to display in the mouseover, and I notice that adding the qtip is generating a lot of mouseover events that crash the browser:

  $('.result-company-name').mouseover(function() {
            var key = $(this).parent().parent().parent().find('.result-company-key').text();

            var group = thisview.objGroup.getGroupFromKey(key);
            var contacts = group.spotlight().fields.contacts;

            if(!contacts)
                return;

            var qt = $(this).qtip(
            {
                content: contacts.length,
            });
            qt.qtip("show");

}

Any thoughts? Thanks.

A: 

Maybe you are generating an infinite loop somewhere?

Elzo Valugi
It appears the problem is directly related to the qtip function. I notice that my mouseover function is called once for each mouse over, normally. However, with the qtip function inside, mouseover triggers once, then twice (on one single mouseover), then it loops for ever on the next mouseover, as if qtip is generating mouseover events artificially.
Max
well, qtip website is not working. please provide a link with the plugin so I can take a look.
Elzo Valugi
A: 

Fixed by using show: { ready: true } to show the tooltip right away when I created it. Seems to be working fine.

Max