craigsworks.com - Support Forum

Full Version: qtip show onclick doesn't work
You're currently viewing a stripped down version of our content. View the full version with proper formatting.
I'm trying to get the qtip to display when a link is clicked using

show: { when: { event: 'click' } } - this isn't working i.e. I click and nothing happens.

if I use

hide: { when: { event: 'click' } } - this will hide the tip on click but the tip will show on mouseover by default without me specifying.

I want the qtip to be shown and hidden when the link is clicked. I also want to be able to stop the href but only whe the user has javascript working. Normally I'd use return false; inside .click().

please help

thanks
Hi scarps,

The problem your facing is that your assigning both the hide and show event as 'click' meaning, it will show then hide it immediately. It's a good point and I'll work on fixing this issue on the future. In the mean time, try changing one of them to mousedown:

JS Code
$('selector').qtip(
{
   show{ when: 'click' }
   hide{ when: 'mousedown' }
}):
Thanks Craig,
that helps but unfortunately on mouseup triggers the qtip to appear again!

S
scarps Wrote:Thanks Craig,
that helps but unfortunately on mouseup triggers the qtip to appear again!

Sorry, I really should have tested the code without just assuming it worked. Try changing the show event to "mouseup" instead, that should fix your issue. If not, get back to me so I can look into this futher. I have a feeling this needs some code adjustment to implement correctly.
Hi Craig,

that won't work as the mouseUp is called on each 'click'.

Hope you resolve this soon.

cheers.
This is now fixed as of Beta 4, which can have identical hide and show events.
Reference URL's