Note that there are some explanatory texts on larger screens.

plurals
  1. POTooltip help Matching
    primarykey
    data
    text
    <p>I hoping someone can assist, but I am trying to use qTip2 to display help text when a user hover's over my helpicon3 icon alongside three input text items on my web page.</p> <p>FYI, each item that I have created, I have pre-assigned the tooltip text that I want to display for that item when the user hovers over the helpicon for that input item, i.e.:</p> <pre><code>&lt;span class="itemToolTip" foritem="P35_TEST"&gt;This is some help text from the help section of the item.&lt;/span&gt; &lt;span class="itemToolTip" foritem="P35_A1"&gt;This is some help text for A1 item&lt;/span&gt; &lt;span class="itemToolTip" foritem="P35_B1"&gt;This is some help text for B1 item&lt;/span&gt; </code></pre> <p>o based on this, when I hover over "P35_A1" helpicon, using qTip2, I would see the tooltip text "This is some help text for A1 item".</p> <p>The same would apply for the other two items.</p> <p>The code for this, which I pulled from my view source of my page looks like this:</p> <pre><code>&lt;label for="P35_TEST"&gt;&lt;/label&gt; &lt;td colspan="1" rowspan="1" align="left"&gt;&lt;input type="text" name="p_t04" size="30" maxlength="2000" value="" id="P35_TEST" /&gt;&lt;td colspan="1" rowspan="1" align="top"&gt;&lt;div id="helpicon"&gt;&lt;img src="helpIcon3" border="0" alt="" style="cursor:normal" /&gt;&lt;/div&gt;&lt;/td&gt; &lt;label for="P35_A1"&gt;&lt;/label&gt; &lt;td colspan="1" rowspan="1" align="left"&gt;&lt;input type="text" name="p_t05" size="30" maxlength="2000" value="" id="P35_A1" /&gt;&lt;td colspan="1" rowspan="1" align="top"&gt;&lt;div id="helpicon"&gt;&lt;img src="helpIcon3" border="0" alt="" style="cursor:normal" /&gt;&lt;/div&gt;&lt;/td&gt; &lt;label for="P35_B1"&gt;&lt;/label&gt; &lt;td colspan="1" rowspan="1" align="left"&gt;&lt;input type="text" name="p_t06" size="30" maxlength="2000" value="" id="P35_B1" /&gt;&lt;td colspan="1" rowspan="1" align="top"&gt;&lt;div id="helpicon"&gt;&lt;img src="helpIcon3" border="0" alt="" style="cursor:normal" /&gt;&lt;/div&gt;&lt;/td&gt; </code></pre> <p>Now the jQuery code with qTip2 that I have and is not working is below.</p> <p>Obviously, it's the context text part I am having issues with because what I am trying to do with the .each function is match the item help icon I am hovering with the itemtooltip foritem help above appear in my tooltip.</p> <pre><code>$(document).ready(function() { $('span.itemToolTip').each(function(i){ $('#helpicon').qtip({ content: { text: $('label[for="' + $(this).attr('foritem') + '"]').attr('title',$(this).html()) }, style: { classes: 'ui-tooltip-dark ui-tooltip-rounded', height: 5, width: 100 }, position: { my: 'bottom center', at: 'top center', viewport: $(window) } }); }); }); </code></pre> <p>Again, if I hover over "P35_TEST" helpicon, using qTip2, I would see the tooltip text "This is some help text from the help section of the item."</p> <p>Hoping someone can assist with matching label helpicon to actual tooltip text.</p> <p>Further to this, if people can perhaps provide another means that also utilises qTip2, that would also be appreciated.</p> <p>Thanks.</p>
    singulars
    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.
 

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