Sample code for tooltip

Game development with Board Game Arena Studio
Post Reply
User avatar
giron1950
Posts: 4
Joined: 10 January 2014, 22:47

Sample code for tooltip

Post by giron1950 »

Anyone has sample code for doing a tooltip when hovering the mouse over a <div>, like the one used in Seasons.
User avatar
Een
Posts: 3861
Joined: 16 June 2010, 19:52

Re: Sample code for tooltip

Post by Een »

Hi,

You should first take a look at http://en.doc.boardgamearena.com/Stock, function onItemCreate.

In the example, please note that _("Some nice tooltip for this item") can be replaced by custom built html code depending on context such as :

Code: Select all

var html = '<div class="mytooltip">' + _("Some title") + '<hr />' + _("Some description") + '<div class="some_background_image_css_for_' + card_type + '"></div></div>';
this.addTooltip( card_div.id, html, '' );
Cheers,
Een
Post Reply

Return to “Developers”