These are all generated using javascript using createElementNS() with
the appropriate XUL namespace as the first parameter.
Generating these works fine.
I would like to add some tooltip functionality to both the tabs and the
listbox items:
For the tabs (as I am cropping them to fit the real estate) I want to
have hover help which is actually the full version of the tab text (as
it was before it was displayed cropped).
For the listitem elements I'd like to show some additional information
relating to the listitem.
Any ideas as to how I do this for dynamically-generated elements?
Thanks, Martin
Martin Packer, IBM
> I would like to add some tooltip functionality to both the tabs and
> the listbox items:
The easiest way would appear to be to set appropriate tooltiptext on the
elements, although this is currently limited to one line of text.
--
Warning: May contain traces of nuts.
I tried that. Perhaps it's my incompetence but the tooltiptext never
appeared. Should I persist?
Thanks, Martin
ChatZilla does a pretty similar thing (though not on a
listbox/listitems). It uses a <tooltip> element and some custom
attributes on the items, combined with a general mouseover event listener.
See:
http://lxr.mozilla.org/seamonkey/source/extensions/irc/xul/content/config.xul#66
(tooltip)
http://lxr.mozilla.org/seamonkey/source/extensions/irc/xul/content/config.js#1256
(listeners)
http://lxr.mozilla.org/seamonkey/source/extensions/irc/xul/content/config.js#693
(attribute setting)
http://lxr.mozilla.org/seamonkey/source/extensions/irc/xul/content/config.js#904
(showing/hiding the tooltip)
Hope that helps,
Gijs
As for the listitems, I'll have to use a similar technique - but perhaps
with a delay.
Martin