Post Reply 
 
Thread Rating:
  • 0 Votes - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
destroy dynamic tooltip onHide ?
26th December, 14:50
Post: #1
destroy dynamic tooltip onHide ?
Hello,
I am dynamically generating tooltips on my site using qTip. The qTips contain a form that is submitted via ajax. After the form is submitted, I would like to destroy the tooltip, along with its contents.

The contents of my tooltip has a button with an onclick attribute like this:
onclick="ajaxSubmitStuff($(this).parent('form').serialize()); $(this).parents('.qtip').qtip('hide')"


I havetried hooking the onHide trigger, which seems to cause an infinite loop:
onHide: destroyTooltip

function destroyTooltip() {
$(this).qtip('destroy');
}

any suggestions on how to destroy a tooltip after it hides would be helpful.

Thanks in advance,
Mike
Find all posts by this user
Quote this message in a reply
29th December, 14:31
Post: #2
destroy dynamic tooltip onHide ?
mjpowersjr, have you tried using the beforeHide callback instead?

Craig Thompson
Web Developer / Designer
Craigsworks
http://www.craigsworks.com
Visit this user's website Find all posts by this user
Quote this message in a reply
30th December, 04:40
Post: #3
destroy dynamic tooltip onHide ?
craig Wrote:mjpowersjr, have you tried using the beforeHide callback instead?

Nope, just gave that a shot. Hooking beforeHide doesn't seem to throw an error in Chrome's javascript debugger, but the tooltip no longer hides ( and still remains in dom).


If I hook onHide, the following error is thrown continuously (~10 per second) after the tooltip hides.

jquery.qtip-1.0.0-rc3.js:33 Uncaught TypeError: Cannot read property 'interfaces' of undefined


Thanks for the help, I tried to poke around the qtip lib to see whats going on, but I'm still pretty new to javascript.
Find all posts by this user
Quote this message in a reply
31st December, 14:06
Post: #4
destroy dynamic tooltip onHide ?
mjpowersjr, how about simply queueing the destroy after the hide effect as taken place?

JS Code
$(this).parents('.qtip').qtip('hide').queue(function(){ $(this).qtip('destroy') });

Craig Thompson
Web Developer / Designer
Craigsworks
http://www.craigsworks.com
Visit this user's website Find all posts by this user
Quote this message in a reply
Post Reply 


Possibly Related Threads...
Thread: Author Replies: Views: Last Post
  [Solved] Dynamic Content From Page Element frogg3862 2 96 3rd May 17:12
Last Post: frogg3862
  Dynamic contenct not working property in sortable cleung 5 743 8th December 18:45
Last Post: Craig
  [Solved] dynamic tipcreation alnikitich 1 450 8th December 18:29
Last Post: Craig
  [Solved] Dynamic content based off map area befeetback 1 1,051 25th August 18:23
Last Post: Craig
  how to get dynamic attri('id') before displaying on content davidkhan 3 627 23rd August 18:04
Last Post: Craig
  [Solved] Blanket Destroy not working migdalskiy 2 514 22nd August 22:44
Last Post: migdalskiy
  [Solved] Dynamic content not showing? dabd 3 821 21st August 18:17
Last Post: Craig
  [Solved] dynamic content based on child eement yisman 8 1,231 27th July 14:29
Last Post: yisman
  Trying to load Dynamic Content using qTip v1 sman1 1 990 6th June 11:38
Last Post: Craig
  [Solved] dynamic content loop & updateContent opalepatrick 6 1,208 24th May 17:21
Last Post: Craig



User(s) browsing this thread: 1 Guest(s)