Note that there are some explanatory texts on larger screens.

plurals
  1. POIs it possible to show a qtip with a function call?
    primarykey
    data
    text
    <p>I am currently trying to create a text selection script so that people can mark a text and then let it being inserted into a form.</p> <p>Thus I want to show a popup with a link "send to form", but I am having problems creating a tooltip with qtip (which I am using everywhere on my site) from my script which finds out if a text has been marked or not (there shall not be a link if my script cannot copy anything).</p> <p>I am using this script for the selection detection: <a href="http://mark.koli.ch/2009/09/use-javascript-and-jquery-to-get-user-selected-text.html" rel="nofollow">http://mark.koli.ch/2009/09/use-javascript-and-jquery-to-get-user-selected-text.html</a></p> <p>And where there currently is a an <code>alert</code>, there shall be a call to a qtip later:</p> <pre><code>Kolich.Selector.mouseup = function(){ var st = Kolich.Selector.getSelected(); if(st!=''){ alert("You selected:\n"+st); // here will be showQTipAtMouseButtonFixed() } } </code></pre> <p>Now the problem seems to be that whole qtip is focussed on hover. I can of course wrap a function around the <code>.qtip()</code> call, but this does not really solve the problem. Then the tooltip will be attached to my function and still showed <strong>only when I hover</strong> the element it is attached to.</p> <p>This would be the qtip with wrapped function</p> <pre><code>function showQTipAtMouseButtonFixed() { $('#content').qtip({ content: 'Hello!', position: { target: 'mouse', adjust: { mouse: false } }, hide: { fixed: true }, style: { tip: true, classes: 'ui-tooltip-red' } }); } </code></pre> <p>Using <code>this</code> instead of <code>"#content"</code> (which I saw in related posts) does not work either.</p> <p>But I want it to be active in background all the time and display when the Kolich.Selector says "And now you are displayed!".</p> <p>I also found a hint on <code>show: 'click'</code> <a href="http://craigsworks.com/projects/forums/thread-show-a-qtip-from-a-function" rel="nofollow">via Google</a>, but that’s not the solution either. It only works when you really assume a click, but in my case it’s rather double-click or mouse moving or keyboard.</p> <p>Is this possible with qtip or do I have to use CSS <code>display</code> from scratch?</p>
    singulars
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload