I'm not sure what is causing this, but I am using cluetip and binding it to a live event (either click or mouseenter), but in each situation the cluetip isn't firing until after one click or hover event. I am using the live event for ajax loaded content, but I'm also having this issue with non-Ajax loaded content. I'm not sure why this is happening - can anyone see where I might be going wrong? Many thanks.
$("a.jTip").live("click", function(){
$('a.jTip').cluetip({
attribute: 'href',
cluetipClass: 'jtip',
arrows: true,
activation: 'click',
ajaxCache: false,
dropShadow: true,
sticky: true,
mouseOutClose: false,
closePosition: 'title'
})
return false;
});
Well that's because you're not setting it up until after the first event. In other words, you're handling the event (obviously) and you set up the facility in the handler. That particular event is not going to trigger the cluetip code.
Instead of doing that, you might consider either making sure your code that dynamically adds content always calls the "cluetip" setup directly, or else investigate the "LiveQuery" plugin to do "automatic" work upon DOM changes. Personally I'd go with the former approach, but lots of people apparently use LiveQuery with good results.