Skip to content Skip to sidebar Skip to footer

Change Opacity Of Image.map Area

I have a small image, with image map placement. Whenever area is clicked, I would need to change opacity of test2 area only, no matter if test1, test2 or test3 area is clicked. As

Solution 1:

$('map area').on('click', function() {
   $('area[alt="test2"]').css('opacity', '0.1');
});

or

$('map area').on('click', function() {
   $('area[alt="test2"]').attr('css', 'opacity:0.1');
});

Solution 2:

Trythis: 

    $('area').on('click', function() {
      $("area[alt=test2]").css('opacity', '0.1');
    });

This will change the opacity of all elements with 'alt' attribute text value equal to "test2".

Solution 3:

Try using

$('area[alt=test2]').css({'opacity':'0.1'});

Post a Comment for "Change Opacity Of Image.map Area"