Tooltips with dynamic content
Posted: 07 October 2015, 21:37
Okay, so I'm starting to look at polishing the game up a bit and I thought I'd start with the tooltips.
I was previously using something similar to:
Whilst I would still like to add these tool tips to my tiles, they overwrites the standard tool tips I have now created (and I can't see an appendTooltipToClass option instead).
I have now got my standard tooltips set up:
but when I attempt to update the helper div with:
I get
I'm clearly missing something straightforward: any ideas?
I was previously using something similar to:
Code: Select all
this.addTooltipToClass( 'possibleLocation', '', _('Place a worker here to activate the tile<hr>') );I have now got my standard tooltips set up:
Code: Select all
var html = '<div id="help_' + tid + '"></div>Tooltip for tile ' + tid + '<hr><div class="tile tile_' + tid + '_' + side + '"></div>';
this.addTooltipHtml( 'tile_' + tid, html, '');Code: Select all
$('help_' + possibleLocations[ x ].id).innerHTML = 'Place a worker here to activate the tile<hr>';Code: Select all
Cannot set property 'innerHTML' of null