Note that there are some explanatory texts on larger screens.

plurals
  1. POan effect onto gallery of images using same javascript
    primarykey
    data
    text
    <p>i have the following code using which i implement effects on an image using javascript. the effect is like when an user hovers on the main image then the over1 and over2 are the two images which gets overlayed on it providing decent information.</p> <p>now my problem is-- the code i got is for only single images. when i am implementing it on gallery of images then even i hover on only one image still all images get overlayed with their information.</p> <p>i need help regarding that if i hover on then other images shouldn't be displaying their info only one should be active.</p> <p>i also need to know how should i store my images in folders. so far i had decided to make one for main images and other for overlaying images.</p> <p>my code is</p> <pre><code>&lt;html&gt; &lt;head&gt; &lt;link href="css/overlaycss.css" rel="stylesheet" /&gt; &lt;script src="js/jquery.min.js" type="text/javascript"&gt;&lt;/script&gt; &lt;script type="text/javascript"&gt; $(document).ready(function() { $(".main").mouseenter(function() { $(".overlay").show(); }); $(".main").mouseleave(function() { $(".overlay").hide(); }); $(".main").mouseenter(function() { $(".overly").show(); }); $(".main").mouseleave(function() { $(".overly").hide(); }); }); &lt;/script&gt; &lt;/head&gt; &lt;body style="margin:0px; padding-top:0px"&gt; &lt;ul&gt; &lt;li&gt; &lt;a href=""&gt; &lt;img class="main" src="image/productold.JPG" /&gt; &lt;img class="overlay" src="image/overlay/over1.jpg"/&gt; &lt;img class="overly" src="image/overlay/over2.jpg"/&gt; &lt;/a&gt; &lt;/li&gt; &lt;li&gt; &lt;a href=""&gt; &lt;img class="main" src="image/productold.JPG" /&gt; &lt;img class="overlay" src="image/overlay/over1.jpg"/&gt; &lt;img class="overly" src="image/overlay/over2.jpg"/&gt; &lt;/a&gt; &lt;/li&gt; &lt;/ul&gt; &lt;/body&gt; &lt;/html&gt; </code></pre> <p>css is--</p> <pre><code>li{ position:relative; float:left; padding-left:5px; } .main { width:200px; height:200px; } .overlay { position:absolute; height:50px; width:150px; top:0; left:0; display:none; } .overly { position:absolute; height:50px; width:150px; bottom:0; right:0; display:none; } </code></pre>
    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