say
say

Reputation: 2655

After qTip destroy qTip doesn't display again if called

I am using jQuery 1.4.2 and qTip 2.0 pre.

I have a qTip displaying with an onClick of an object and closing with a mouseleave. I use the JS below to destroy it after the mouseleave. When I click on the object after the qTip never displays again. If I remove the destroy function then it works as expected.

I want to destroy it after hide so it isn't stored on in the DOM.

JS used:

events: {
  hide: function(api, event) {                       
  return $('.qtip').qtip('destroy');
  }
}

What am I doing wrong?

Upvotes: 1

Views: 2106

Answers (1)

Dennis Burton
Dennis Burton

Reputation: 3332

Since your qtip is destroyed you would have to set it back up again. I am guessing this is worse than the cluttered DOM.

return $('.qtip').qtip('destroy').qtip( recursive init params here - hide refs this function all over again )

Since you can't really do this recursive definition, you will need to break out the function and the json initialization object. This is all starting to sound like a nasty hack.

I would vote for not destroying the qtip given this ugliness.

Upvotes: 2

Related Questions