lulu lulu - 7 months ago 40
Javascript Question

how to make a transparent image in jQuery?

I want to make the A image transparently when the mouse pointer is over the B image
so that I can see either image.

How should I change this?

enter image description here


If you are having trouble with posting code here, read this. Make sure you include this with any jQuery code you use:

<script src="//"></script>

This demo is simplified to show some possibilities.


$(function() {
  $('.B').mouseover(function() {
    $('.A').css('visibility', 'hidden');
  $('.B').mouseleave(function() {
    $('.A').css('visibility', 'visible');
.invisible {
  display: none;
<script src=""></script>

<img src="" class="A">
<img src="" class="B">
<img src="" class="C">
<img src="" class="D">