craigsworks.com - Support Forum

Full Version: [Solved] Calling qtip without using selector
You're currently viewing a stripped down version of our content. View the full version with proper formatting.
Hi,

I am working on a text translation and i want to show the translated text via qtip. There is a demo here but it doesnt useful for me. I want qtip to appear over the selected text after a function called. In this case the selection can be everywhere on the page that user wants and what will be the jquery selector now?

I think there are two solutions for me:
1- Getting X,Y coordinates of the selection and show qtip over there.
But how can i do that? Is there a function without using selector like show_qtip('content', x, y);
2- Getting the selected text as a jquery selector and show qtip over there.
But is it possible? Is there a way to use the selection in query selector string? I know something about :selection pseudo-class but can it be used as selector?

Shortly, thats what i want to do:
[Image: 890.jpg]

Thanks.
The way I did it was to initialise qTip on the document.body, but specified both the show/hide events as false, so it won't show unless explicitly called. Then use a custom method to detect text selection and call .show() explicitly.

Take a look here (warning: this uses qTip2 not qTip 1.0): http://craigsworks.com/projects/qtip_new...te?preview
Reference URL's