webgui/www/extras/hoverhelp.js
2007-11-01 18:19:07 +00:00

20 lines
684 B
JavaScript

var hoverHelpLoaded;
YAHOO.util.Event.onDOMReady(function () {
if (hoverHelpLoaded)
return;
hoverHelpLoaded = true;
var tips = YAHOO.util.Dom.getElementsByClassName('wg-hoverhelp');
for (var i = tips.length; i--; ) {
var myTip = new YAHOO.widget.Tooltip(tips[i], {
autodismissdelay: 1000000,
context: tips[i].parentNode
});
myTip.beforeShowEvent.subscribe(function() {
YAHOO.util.Dom.addClass(this.element, 'wg-hoverhelp-visible');
});
myTip.beforeHideEvent.subscribe(function() {
YAHOO.util.Dom.removeClass(this.element, 'wg-hoverhelp-visible');
});
}
});