Note that there are some explanatory texts on larger screens.

plurals
  1. POjquery show div on hover in php cicle from database
    text
    copied!<p>I'm actually facing a problem with div ids while generating a product list. I'm using a fade in effect and hide effect on a text link</p> <p>here is a portion of code:</p> <p>javascript</p> <pre><code>$('.theLink').hover( function () { $('.theDiv').fadeIn(); }, function () { $('.theDiv').hide(); }); </code></pre> <p>css</p> <pre><code>.theDiv { display: none; margin-top:-7px; background-color:#fff; width: 148px; line-height:100%; border:1px solid #c3c3c3; background:#fff; -moz-border-radius:3px; -webkit-border-radius:3px; border-radius:3px; position: relative; padding: 10px; } </code></pre> <p>html</p> <pre><code>&lt;div class="theLink"&gt;Compatibilit&amp;agrave;&lt;/div&gt; &lt;div class="theDiv"&gt;' . $something . '&lt;/div&gt; </code></pre> <p>variabile <code>$something</code> works correctly and display correct detail on each item in products the list When i go over <code>theLink</code> it opens <code>theDiv</code> in each item of the list instead of only the current one with i'm over.</p> <p>I hope to have been clear. Thanks in advance for any help.</p> <p>ADDED:</p> <p>I'm going to add the implemented code to let you understand where the part is placed</p> <pre><code>&lt;div class="content"&gt; &lt;div class="bordobasso"&gt; &lt;div class="theLink"&gt; &lt;div class="compatibilita"&gt;Compatibilit&amp;agrave;&lt;/div&gt; &lt;/div&gt; &lt;div class="dettagliprodotto"&gt;Acquista&lt;/div&gt; &lt;/div&gt; &lt;/div&gt;&lt;div class="theDiv"&gt;' . $new_products['products_id'] . '&lt;/div&gt; </code></pre> <p><code>content</code> already have another jquery function to expand item from the list and place some css</p>
 

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