javascript - How to add Active Link or Image to image mapping -


when click link of first area want image 270orange.png active. i'm not sure if achievable, please me if is.

img id="image-maps_9200905221105171"   src="270vob.png" usemap="#image-maps_9200905221105171" border="0"    width="270" height="270" alt=""  map id="_image-maps_9200905221105171" name="image-maps_9200905221105171"  area shape="poly" coords="134, 43, 211, 178, 219, 177, 231, 174, 243, 169, 254, 159, 263, 144, 267, 128, 267, 113, 263, 95, 257, 79, 249, 65, 237, 48, 224, 35, 207, 22, 185, 11, 168, 6, 148, 2, 128, 2, 111, 4, 92, 9, 78, 14, 69, 19, 82, 17, 95, 16, 108, 19, 119, 25, 129, 35"   href="#" alt="identity" title="identity"   onmouseover="if(document.images) document.getelementbyid('image-maps_9200905221105171').src= '270orange.png';"   onmouseout="if(document.images) document.getelementbyid('image-maps_9200905221105171').src= '270vob.png';"/  area shape="poly" coords="57, 177, 52, 189, 49, 203, 49, 214, 51, 224, 57, 235, 63, 245, 67, 250, 54, 242, 43, 231, 29, 216, 19, 200, 9, 179, 3, 155, 2, 133, 4, 111, 9, 91, 17, 72, 29, 54, 41, 40, 55, 29, 72, 22, 91, 20, 108, 23, 119, 30, 127, 38, 134, 47"   href="#" alt="technology" title="technology"   onmouseover="if(document.images) document.getelementbyid('image-maps_9200905221105171').src= '270violet.png';"   onmouseout="if(document.images) document.getelementbyid('image-maps_9200905221105171').src= '270vob.png';"  area shape="poly" coords="212, 178, 222, 179, 233, 178, 247, 169, 258, 160, 265, 148, 268, 135, 267, 154, 263, 171, 255, 192, 246, 209, 235, 225, 219, 239, 203, 249, 183, 259, 159, 266, 140, 268, 123, 267, 106, 265, 86, 258, 75, 252, 65, 242, 59, 232, 53, 219, 52, 204, 55, 191, 59, 179"   href="#" alt="space" title="space"   onmouseover="if(document.images) document.getelementbyid('image-maps_9200905221105171').src= '270blue.png';"   onmouseout="if(document.images) document.getelementbyid('image-maps_9200905221105171').src= '270vob.png';" 

i'm not sure i'm understand meant, if did, want change displayed image on click.

if issue, can try this:

document.getelementbyid('image-maps_9200905221105171').onclick = function () {     document.getelementbyid('image-maps_9200905221105171').src = 'image 270orange.png'; }; 

if you're looking wider solution in 1 item can active, suggest change structure bit (and use jquery), here suggestion in jsfiddle.


Comments

Popular posts from this blog

twig - Using Twigbridge in a Laravel 5.1 Package -

jdbc - Not able to establish database connection in eclipse -

Kivy: Swiping (Carousel & ScreenManager) -