0

SOLVED USING JQUERY*

I have two tables in a custom module. One is always on display and the other one is hidden. When I hover on the first <td> of the visible table, the hidden table below the visible one needs to fade in.

I have looked into a few answers on this topic and even though I followed the CSS styling to a T, it still doesn't want to work.

<div class="partnersnew">
<table class="index" width="100%">
<tbody>
<tr>
<td>
<div id="testdiv1"><img src="images/partners/tableimages/img1.jpg" alt="" />Text 1</div>
</td>
<td><img src="images/partners/tableimages/img2.jpg" alt="" />Text 2</td>
<td><img src="images/partners/tableimages/img3.jpg" alt="" />Text 3</td>
<td><img src="images/partners/tableimages/img4.jpg" alt="" />Text 4</td>
</tr>
</tbody>
</table>

<br />

<table class="index2">
<tbody>
<tr>
<td><img src="images/partners/test/partnerlogo.jpg" alt="" /></td>
</tr>
</tbody>
</table>
</div>
.partnersnew .index2 {

    display:none;

}
.partnersnew table.index #testdiv1:hover + .index2{
    display: block;

}

WORKING JS CODE I USED BELOW

<script>
$(function() {
$("#testdiv1").hover(function() { 
    $(".index2").fadeIn(); 
}, function() { 
    $(".index2").fadeOut(); 
});
});
</script>

There are not any error messages. This is simply not working. I followed the exact same code as some of the answers here. Am I doing something wrong?

0 Answers0