Search code examples
qtip2jgrowl

Why does qTip2 use .removeData() and .data() in the growl example


I'm starting to use qTip2, and I'm looking the demos of the site. I was trying to understand this one but I didn't understand this so much. I can't understand this part:

...
}).removeData('qtip');
...
$(this).data('qtip');
...

I'd like to know why and for what .removeData() and .data() were used. Could someone help me to understand it?


Solution

  • In the official forum of qtip 2, the creator of qtip2, Craig, answered me!

    Craig Wrote: "The removeData is just a "hack" to allow more than one qTip to be bound to a single element at any one time, hence allowing multiple jGrowl(s). The .data() call is just there to grab the qTip API object from each of the matched objects."

    :)