Post Reply 
 
Thread Rating:
  • 0 Votes - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
how to access api callbacks?
4th May, 14:37
Post: #1
how to access api callbacks?
Hello, first of all thanks for the nice plugin.

I was trying to get something done before tooltip is shown, but couldn't access the api.

var tooltip = $('[tooltip]').qtip("api");

tooltip.qtip({
onShow: function(event){
console.log("anything");
},
content: 'Any content',
style: 'cream',
})

i assumed that accessing api should be something like above, because i could not find any example in the site. Here i want to write "anything" to firefox's console, but no luck.

Can someone correct me?

Thanks in advance.
Sinan.
Find all posts by this user
Quote this message in a reply
4th May, 20:20
Post: #2
how to access api callbacks?
I'm confused as to what you're trying to do exactly? Simply specify an onShow callback within the tooltip? IF so, you do this at runtime within your options object:

JS Code
$('[tooltip'].qtip(
{
   api: {
      onShow: function(){ console.log('anything') }
   }
});

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
4th May, 21:05
Post: #3
how to access api callbacks?
Actually I was trying to do exactly what you have shown.

When I have seen that line below in documentation part, i was little bit confused with your syntax.

"var api = $(mytooltip).qtip("api"); // Access the API via the tooltip"

Now it is clear, thanks.
Find all posts by this user
Quote this message in a reply
Post Reply 


Possibly Related Threads...
Thread: Author Replies: Views: Last Post
  Accessing target elements from API? jizepi 0 48 16th March 11:09
Last Post: jizepi
  Difficulty with show api Ben Jacobs 2 1,692 29th January 22:35
Last Post: Craig
  Accessing API Attributes Christian 2 2,531 26th May 20:50
Last Post: Christian



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