Hello and welcome to our community! Is this your first visit?
Register
Enjoy an ad free experience by logging in. Not a member yet? Register.
Results 1 to 3 of 3
  1. #1
    New to the CF scene
    Join Date
    May 2012
    Posts
    3
    Thanks
    0
    Thanked 0 Times in 0 Posts

    help with image coordinates

    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?

  • #2
    New to the CF scene
    Join Date
    May 2012
    Posts
    3
    Thanks
    0
    Thanked 0 Times in 0 Posts
    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

  • #3
    New to the CF scene
    Join Date
    May 2012
    Posts
    3
    Thanks
    0
    Thanked 0 Times in 0 Posts
    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..


  •  

    Posting Permissions

    • You may not post new threads
    • You may not post replies
    • You may not post attachments
    • You may not edit your posts
    •