Please Log-in or Register to get full access to the forums.


Post Reply 
 
Thread Rating:
  • 0 Votes - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
show a qtip from a function
21st April, 11:00
Post: #1
show a qtip from a function
Is it possible to show a qtip from a standard javascript function..


e.g.

function myjavafunction(){

//code to show a qtip will go here; for example showmytip('dom id');

}

The reason i ask is because i have an ajax function which will return 1 of 2 values

if it returns a 0 i want it to auto show a qtip; if it returns a 1 i want it to do something else..

is this possible??

can i also add that i am not using jquery to process or handle any of my ajax stuff so its important that a solution does not incorperate jquery based ajax code.(of course i know i have to use jquery for qtip)

Thanx.. really appreciate your efforts so far and the fact that u give tech support on the FREE product is simply brilliant!!

thank you again!
Find all posts by this user
Quote this message in a reply
21st April, 13:38
Post: #2
show a qtip from a function
Take a look at Show Option reference http://craigsworks.com/projects/qtip/doc...ence/#show

and try with this sample code.

html

JS Code
<a class="" href="#" o<strong></strong>nclick="showtooltip(this);">Lorem ipsum dolor</a>


javascript

JS Code
<script type="text/javascript">
function showtooltip(item){
   $(item).qtip(
   {
      content: 'Some basic content for the tooltip', 
     show: 'click'
   });
}
</script>


Cheers.
Find all posts by this user
Quote this message in a reply
18th May, 15:03
Post: #3
show a qtip from a function
bellzebu Wrote:Take a look at Show Option reference http://craigsworks.com/projects/qtip/doc...ence/#show

and try with this sample code.

html

JS Code
<a class="" href="#" o<strong></strong>nclick="showtooltip(this);">Lorem ipsum dolor</a>


javascript

JS Code
<script type="text/javascript">
function showtooltip(item){
   $(item).qtip(
   {
      content: 'Some basic content for the tooltip', 
     show: 'click'
   });
}
</script>


Cheers.


hello,

thank you for this example.
I tried it and it runs.
but the tip comes only after second click. after the tooltip first shows, the tooltip comes every time I mouseover the link.

so it runs not as wished within a function.

any idea?

thanks

bye
Chris
Find all posts by this user
Quote this message in a reply
18th May, 18:37
Post: #4
show a qtip from a function
Hi Chrisi, try out this example, which should solve you're problem:

HTML:
JS Code
<a class="" href="#" o<strong></strong>nclick="showtooltip(this);">Lorem ipsum dolor</a>


J
JS Code
function showtooltip(item)
{
   // If a tooltip is present, show it
   if($(item).qtip('api'))  $(item).qtip('api').show();
 
   // No tooltip present, create it
   else
   {
      $(item).qtip(
      {
         content: 'Some basic content for the tooltip', 
         show: {
            when: 'click',
            ready: true
         }
      });
   }
}
Visit this user's website Find all posts by this user
Quote this message in a reply
18th May, 19:09
Post: #5
show a qtip from a function
craig Wrote:Hi Chrisi, try out this example, which should solve you're problem:

HTML:
JS Code
<a class="" href="#" o<strong></strong>nclick="showtooltip(this);">Lorem ipsum dolor</a>


J
JS Code
function showtooltip(item)
{
   // If a tooltip is present, show it
   if($(item).qtip('api'))  $(item).qtip('api').show();
 
   // No tooltip present, create it
   else
   {
      $(item).qtip(
      {
         content: 'Some basic content for the tooltip', 
         show: {
            when: 'click',
            ready: true
         }
      });
   }
}

Hello Craig,

thank you very much.
Thats it.

I'm so happy.

Bye
Chris
Find all posts by this user
Quote this message in a reply
Post Reply 


Possibly Related Threads...
Thread: Author Replies: Views: Last Post
  How to call javascript function within Qtip to show and hide div msgmanna 1 1,174 12th August 12:16
Last Post: Craig
  [Solved] Hide current div when show qtip sammy 4 1,344 2nd May 01:13
Last Post: sammy
  [Solved] show html in qtip apfel007 2 1,110 12th February 09:07
Last Post: apfel007
  [Solved] Show qtip (never hide), and destroy on mouseover after n-seconds delay shmul 2 1,916 11th November 12:29
Last Post: shmul
  Adding a simple function to "content:" to select desired text lzw8bk 0 1,406 31st May 19:26
Last Post: lzw8bk
  js only show admeis 1 1,227 6th February 18:00
Last Post: Craig
  show qtip in a specified div or position myapweb 1 1,891 27th December 17:53
Last Post: Craig
  qtip not appearing on .show command josephkhoury 1 1,360 20th December 13:58
Last Post: Craig
  [Solved] Show qTip when button pressed sulfurcode 1 1,569 1st December 11:15
Last Post: Craig
  [Solved] How to call javascript function within Qtip? When2Meets2 7 3,984 19th September 16:49
Last Post: Craig



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