...

View Full Version : help with image coordinates



dB09
05-24-2012, 09:59 AM
Hi.
So i have an image, lets say a cow. When i click on part of the body, it shall show information about it, for example head. I have coordinates in javascript in array(position and size),but i have no idea what should i do later?? Onclick and switch?

dB09
05-24-2012, 11:19 AM
thanks for reply.
the problem is i can't edit index.html file and body contains only something like that:

<div id="parts">
<li></li>
</div>
<div id="body_map"><img src="body.jpg"></div>

i cant add onclick or usemap :S

dB09
05-24-2012, 11:35 AM
Sorry for confussion, but at the time i was posting i didn't know that :). Neither i can't split image, it's for my class and those are requirements.

As i said, html looks like above and js is an array with name of body part, and it's position(top, left) and size(height,width).

My newest guess is to find position of x and y using addEventListener, here's an example:

http://jsfiddle.net/madBYK/UumUP/

but i don't understand why it works only with <table> tags..



EZ Archive Ads Plugin for vBulletin Copyright 2006 Computer Help Forum