Download

About

Guild Wars 2 item tooltip is a JavaScript utility to add tooltips for Guild Wars 2 items to display information about them. No frameworks required and simple to use.


How it works

Tooltips can be added in two ways:

  • by supplying the information to be displayed directly (using ItemTooltip.addDirect); or
  • by giving the ID of the item (using ItemTooltip.addNow).
With the latter option the Guild Wars 2 API is accessed and up-to-date information is retrieved and used to create the tooltip. Note that this option does not work in Internet Explorer versions 9 and below; it does, however, work on every other major browser.
For more information you can refer to the documentation.


Demo

Code

                        <head>
                            <!-- Include the script and style -->
                            <script src="js/ItemTooltip.js"></script>
                            <link rel="stylesheet" href="css/ItemTooltip.css" />
                        </head>
                        <body>
                            <!-- Add the tooltip to an element -->
                            <a id="demoItemTooltip">This is an item tooltip.</a>
                            <script>
                                GW2Tooltip.addNow(document.getElementById("demoItemTooltip"), 46762, ItemTooltip);
                            </script>
                        </body>
                    

Result

This is an item tooltip. (it may take a second to appear if you just loaded this page)

Q&A

Q: Does it work with traits/skills/waypoints too?

A: At the moment it works for items only, but I'm planning on adding this functionality later on.

Q: Why don't crafting materials display the required crafting disciplines and their levels?

A: The Guild Wars 2 API does currently not offer a way to retrieve this information, or at least not directly from the item itself.

Q: Does it work with JQuery, Underscore, Backbone, Angular etc.?

A: Yes. It does not require any framework and it should not collide with any framework either.