Hello.

I have a problem with the tooltip plugin.

I have several dynamicaly created images, with different id's and
classes; the same goes for DIVs that i will use to fill the contents
for the tooltip, here's the code (i'm using PHP):

echo '<img border="0" class="tooltip '.$filterKey.'" id="img-'.
$filterKey.'" style="vertical-align:bottom;" src="'.$this->settings-
>incLib('imagenes/ayuda.gif').'">';
echo '<div id=help_'.$filterKey.' style="display:none;"><span
class="txtInput">'.$filterData['help'].'</span></div>';

the problem comes when i try to set different tooltips for each img,
here's te js code:

$(document).ready(function(){
        $('img.tooltip').each(function(){
                id = this.id.split('-');
                helpId = 'help_'+id[1];
                helpHtml = $('#'+helpId).html();
                $(this).tooltip({
                  track: true,
                  delay: 0,
                  showURL: false,
                  opacity: 0.85,
                 bodyHandler: function(){return(helpHtml);}
                });
        });
});

What i get as a result is putting the last div's html for every img,
instead of actually attaching that div's html to the corresponding
img.

I hope you guys understand.

Thanks in advance

Reply via email to