javascript - How to be able to click a map area and change color to red and be transparent? -


i'm trying make body map when clicked on parts of body, highlighted color red , transparent while staying in state can click on others selection far can't seem find solution.

here sample

http://79.170.44.80/sicuandomain.com/#

thanks!

i not myself familiar map , area implementation. but, after trying jquery plugins exercise , learning, think cause.

jquery plugin : http://davidlynch.org/projects/maphilight/docs/

so, need initalize map jquery plugin , define click event area want use :

$(function () {     //initalize image plugin     $('.map').maphilight({         stroke: false,         //use color want         fillcolor: '000000'     });     //map area selector intercept click event     $('#map area').click(function (e) {         e.preventdefault();         var data = $(this).mouseout().data('maphilight') || {};         data.alwayson = !data.alwayson;         $(this).data('maphilight', data).trigger('alwayson.maphilight');     });   }); 

the document plugin not however. so, can try , use if like.

jsfiddle demo

there lot here removing previous selected area on click event. but, guess can achieve yourself.

and, there other plugins job well. plus should know how plugins works if manually.

i hope cause.


Comments