Letractively / tooltips

Automatically exported from code.google.com/p/tooltips
0 stars 0 forks source link

Tooltip only appears for first element #31

Open GoogleCodeExporter opened 8 years ago

GoogleCodeExporter commented 8 years ago
I want to display tooltips for several input elements in a form.  Only the
first tooltip displays.  This happens whether I call each element by id or
traverse the elements using:

$$("form input.tip").each( function(input) {
            new Tooltip(input, {backgroundColor: "#FC9", borderColor: "#C96",
textColor: "#000", textShadowColor: "#FFF"});
        });

I also get the following javascript error:

'this.el.descendants()' is null or not an object

I'm using Prototype 1.6.0.3 and Scriptaculous 1.8.1.

Original issue reported on code.google.com by hillman....@gmail.com on 10 Nov 2008 at 6:38

GoogleCodeExporter commented 8 years ago
I've used the following as a workaround:

Change the following lines:
this.el.descendants().each(function(el){
    if(Element.readAttribute(el, 'alt'))
        el.alt = "";
});

For:
if (this.el.descendants()!=null)
{
    this.el.descendants().each(function(el){
        if(Element.readAttribute(el, 'alt'))
            el.alt = "";
    });
}

Original comment by edhel...@gmail.com on 26 Nov 2008 at 4:52