0

I'm working with a the JQuery tipsy plugin and I can get it to work fine on my normal php page but when I run data from XML thru another javascript it's not loading or working properly... I've tried every imaginable change/variable and I'm stuck.

All my jquery & jquery.tipsy scripts are linked correctly because it works outside of this JS.

    $(function() {
    $('.instructions').tipsy({gravity: 's'});
});

Then when I call it inside the other JS it won't show at all:

 return "<table cellpadding='8' cellspacing='0'><tr>" +
"<tr>" +
"<td class='mn'>" + vs.manualName + "</td>" +
"<td><a class='instructions' href='#' title='" + vs.manInstr + "'>Instructions</a></td>" +
"<td class='sku'>" + vs.skuNum  "</td>" +
"</tr></table>"
};

Do I have to write it out in the JS for the tipsy to see it?

user961389
  • 423
  • 2
  • 8
  • 19
  • Are you trying to call the plugin `tipsy` on the element `.instructions` before `.instructions` exists on the page? – Rusty Fausak Sep 26 '11 at 03:30
  • Nope. I thought that but I put the tipsy function in every place... before, after, and evne inside the other JS... ahaha. Nothing works. – user961389 Sep 26 '11 at 03:33

1 Answers1

0

You have to ensure that by the time the Tipsy is fired, the .instructions are already loaded and inside the DOM. So after the data from XML thru another javascript is loaded, execute.

    $('.instructions').tipsy({gravity: 's'});
j7m
  • 1,067
  • 8
  • 13