Are you able to define all at once the markup for the tooltips on your page beyond just what is needed initially inside the calendar? For example:
Code:
<div id="mystickytooltip" class="stickytooltip">
<div style="padding:5px">
<div id="sticky1" class="atip" style="width:200px">
tooltip 1
</div>
<div id="sticky2" class="atip" style="width:200px">
tooltip 1
</div>
<div id="sticky3" class="atip" style="width:200px">
tooltip 1
</div>
<div id="sticky4" class="atip" style="width:200px">
tooltip 1
</div>
</div>
<div class="stickystatus"></div>
</div>
In other words, be able to generate all of the tooltips used by the calendar in advance and add it to the page? If so, then Sticky Tooltip script can be modified relatively easily to reinitialize each time your calendar changes, rescan any new links within the calendar carrying data-tooltip="stickyX", and attach the appropriate tooltip on the page to it. Just use the below modified .js file. With it, you would just call the initialization code:
Code:
stickytooltip.init("*[data-tooltip]", "mystickytooltip")
again each time your calendar changes to get the script to rescan it and associate the correct tooltip to the target links. I've included a simple demo below that shows this in action. Using the modified .js file with the below HTML code, when you click on "Canada", the original anchor link is replaced with a link to Canada that in turn shows the tooltip "sticky2" when the mouse hovers over it:
Code:
<p id="t"><a href="http://en.wikipedia.org/wiki/Thailand" data-tooltip="sticky1">Thailand</a></p>
<p>Some page contents here...</p>
<!--HTML for the tooltips-->
<div id="mystickytooltip" class="stickytooltip">
<div style="padding:5px">
<div id="sticky1" class="atip" style="width:200px">
<img src="http://img121.imageshack.us/img121/746/thailand.jpg" /><br />
Thailand boasts some of the most popular and luxurious resorts in Asia.
</div>
<div id="sticky2" class="atip" style="width:200px">
Canada is a beautiful country.
</div>
</div>
<div class="stickystatus"></div>
</div>
<script>
function updateit(){
document.getElementById("t").innerHTML='<a href="#" data-tooltip="sticky2">Canada</a>'
stickytooltip.init("*[data-tooltip]", "mystickytooltip")
}
</script>
<a href="javascript:updateit()">Canada</a>
Bookmarks