I want to change cluetip content after the page is loaded.
Let's say I have a button in my cluetip and after clicking it, I want it gone.
So here's the cluetip:
$('a.notice_tooltip').cluetip({activation: 'click', cluetipClass: 'jtip' ,
local:true , positionBy: 'bottomTop' , arrows: true, sticky: true , closePosition: 'title' });
HTML:
<a class="notice_tooltip" href="#" rel="#info_div" > open tooltip </a>
<div id="info_div">
<input class="btn' type="button" >
<input class="btn2' type="button" >
</div>
Here is the click event:
$('.btn').click(function(){
//do stuff
$(this).parent().append(some_message);
$(this).remove();
})
$('.btn2').click(function(){
//do stuff
$(this).parent().append(some_message);
$(this).remove();
})
This would remove the button and append a message to it's parent but when I reopen the cluetip, it's the old content again.
It's like, the plugin gets the DOM structure when the page is loading and after that, it doesn't care about the page changes.
I've tried to run the plugin again every time it gets closed.
$(function(){
$('.btn').click(function(){
//do stuff
$(this).remove();
})
$('a.notice_tooltip').cluetip({activation: 'click', cluetipClass: 'jtip' , local:true , positionBy: 'bottomTop' ,
arrows: true, sticky: true , closePosition: 'title' , onHide : function(ct,c) {
retooltip();
}
});
})
function retooltip(){
$('a.notice_tooltip').cluetip('destroy');
$('a.notice_tooltip').cluetip({activation: 'click', cluetipClass: 'jtip' , local:true ,
positionBy: 'bottomTop' , arrows: true, sticky: true , closePosition: 'title' , onHide : function(ct,c) {
retooltip();
}
});
}
It's still the same.