Note that there are some explanatory texts on larger screens.

plurals
  1. POmultiple div hover effect on one page
    primarykey
    data
    text
    <p>So I found this script on a different post on here and have changed it to fit my style/site but its only working for 1 div. I would like to use it on multiple divs on the same page though but when I duplicate the divs only 1 of them works. Should it be able to work as all divs are named the same or do I have to name each div different, do separate css for each div AND separate script for each div? im trying to avoid having to add all that coding if not needed as I am setting it up to pull from posts and auto appear with out having to go in and edit coding for it.</p> <p>this is the coding i am using right now. The one on the left works but any additional one i ad doesn't work when i hover over it.</p> <p>HTML</p> <pre><code>&lt;div id="client" style="float:left;"&gt; &lt;div id="client_slider"&gt; &lt;p&gt;content...&lt;/p&gt; &lt;/div&gt; &lt;/div&gt; &lt;div id="client" style="float:left;"&gt; &lt;div id="client_slider"&gt; &lt;p&gt;content...&lt;/p&gt; &lt;/div&gt; &lt;/div&gt; </code></pre> <p>CSS</p> <pre><code>#client { position: relative; overflow:hidden; background-color:#ffff00; width: 320px; height: 320px; } #client_slider { width: 320px; height: 320px; bottom: -320px; right: 0px; background-color: rgba(0, 0, 0, 0.7); position: absolute; color:#fff; } </code></pre> <p>SCRIPT</p> <pre><code>$(function () { $('#client').on("mouseenter", function () { $("#client_slider").animate({ "bottom": "-240px" }, "slow"); }).on("mouseleave", function () { $("#client_slider").animate({ "bottom": "-320px" }, "fast"); }); }); </code></pre> <p>Sample link</p> <p><a href="http://jsfiddle.net/4yhKP/" rel="nofollow">http://jsfiddle.net/4yhKP/</a></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