0

Does anybody know how to use tooltip at runtime using livequery? I found some infos, but for me it doesnt work.

jQuery('.button').bind('click', function () {
    std();
});

function std () {
    jQuery('.abcd').livequery.run(function() {
        jQuery('.abcd').tooltip();
    });
}
jitter
  • 53,475
  • 11
  • 111
  • 124
user270158
  • 421
  • 2
  • 5
  • 9
  • Could you provide examples of what you have tried, and be a little clearer on what it is you're trying to achieve? – gpmcadam Mar 16 '10 at 07:20

1 Answers1

0

I interpret your code to mean this:

When .button is clicked you want to enable the tooltip functionality on all elements with class .abcd. If this is your intention simply use

jQuery('.button').bind('click', function () {
    std(); //activate tooltip support
});

function std () {
    //internal function is called once for every found/new .abcd element
    jQuery('.abcd').livequery(function() {
        $(this).tooltip();
    });
}

Note that probably should prevent .button from being clicked more than once as that could lead to unexpected sideeffects

jitter
  • 53,475
  • 11
  • 111
  • 124