3

I am using jquery cluetip and i have noticed taht in some cases the first time i click on an items it shows the CLOSE text twice, when i click a second time, it only shows it once. So first time i see this:

enter image description here

and the second time i see this:

enter image description here

Has anyone seen this before? I have multiple cluetips on the page but can't see how that would be driving this. Here is my cluetip javascript code:

 $('#myItem').cluetip({
    width: '500px',
    showTitle: false,
    topOffset: 25,
    leftOffset: 5,
    positionBy: 'bottomTop',
    cluetipClass: 'jtip',
    activation: 'click',
    hoverIntent: {
        sensitivity: 7,
        interval: 100,
        timeout: 500
    },
    sticky: true,
    mouseOutClose: true,
    ajaxSettings: {
        dataType: 'json'
    },
    ajaxProcess: function (data) {

        return data.Content;
    }
});

I see the error has been raised here and on this forum also, but i don't see any solution or suggestions given.

Update:

Not sure if this is helpful but i capture the "double" situation in firebug and here is the html that gets produced. As you can see, there are multiple elements with id="cluetip-close"

   <div id="cluetip-inner"><div id="cluetip-close"><a href="#">Close</a></div><div id="cluetip-close"><a href="#">Close</a></div>

I have debugged through the cluetip code and when I get multiple closes, I notice that when it hits this line:

  if (opts.sticky) {
    var $closeLink = $('<div id="cluetip-close"><a href="#">' + opts.closeText + '</a></div>');

the $cluetipInner already has the '

I still can't figure out what situation this happens in . . the only way i can reproduce it, is if I clear all my browser cache and then restart . . maybe some timing issue with the ajax callback?

leora
  • 188,729
  • 360
  • 878
  • 1,366

2 Answers2

3

I think this problem was bug and fixed. Here the fixes close link was being inserted multiple times in some cases. Fixes #34

safarov
  • 7,793
  • 2
  • 36
  • 52
  • yup . .turns out I was on an old version of the library. after upgrading, problem went away – leora Mar 30 '12 at 12:56
-2

You can try this code:

$(function(){
$('.cluetip-close:eq(2)').remove();
});

This will remove the second instance of the close div

Azad Zain
  • 143
  • 11
  • this seems like a hack . .i am trying to figure out why it is showing in tne first place and prevent it from doing that – leora Mar 21 '12 at 20:23
  • also, i now go into a situation where 3 show up so that answer above wouldn't solve that as well. ULtimatley i want to find out why its happening in the first place – leora Mar 26 '12 at 02:47