Post Reply 
 
Thread Rating:
  • 0 Votes - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Difficulty with show api
29th January, 15:55
Post: #1
Difficulty with show api
Hi,
I am having problems with getting the show api to work correctly. I have a dynamically built list and beside each item in the list is a "go" button and when this is pressed it makes an AJAX request and at that point I want to create a dynamically built qtip that then also drops down and displays the results of the AJAX response. The AJAX works fine but I am having problems with the qtip api show not working correctly. Here is a simplified version of the code:

JS Code
function goButtonPressed (){
  $("#qtipDiv").qtip({ 
      content: 'This works',
      style: { 
         tip: {corner:'topLeft'},
         style: {border:{width: 5, radius: 10}}
      },
      position: {corner: { target: 'bottomLeft' } },
      show: { when: { target: $('#some-link'), event: 'click' }, effect: { type: 'slide', length: 250 } },
      hide: { when: { target: $('#some-link'), event: 'click' }, effect: { type: 'slide', length: 250 } }
   });
 
  $('#qtipDiv').qtip('show');
}


Now the tip is being built cause when I click the "some-link" anchor tag, it shows the qtip but the qtip is not being auto displayed when the go button is being pressed and this js is being executed. Thanks for your help... I have been wrestling with this for a couple of days now.

Ben
Find all posts by this user
Quote this message in a reply
29th January, 19:59
Post: #2
Difficulty with show api
I was able to achieve this by removing the
JS Code
$('#qtipDiv').qtip('show');
and then making the some-link <a> tag hidden and doing a
JS Code
$("#some-link").click();


Different solution, same results.
Find all posts by this user
Quote this message in a reply
29th January, 22:35
Post: #3
Difficulty with show api
Ben, you need to add in the show.ready option to your code if you want the tooltip to be bound AND shown on first event fire.

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
  Accessing target elements from API? jizepi 0 48 16th March 11:09
Last Post: jizepi
  Troubles with show/hide xcession 2 1,660 13th November 14:15
Last Post: Tsunamis
  Accessing API Attributes Christian 2 2,531 26th May 20:50
Last Post: Christian
  how to access api callbacks? Sinan 2 2,746 4th May 21:05
Last Post: Sinan



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