• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Jeanne Boyarsky
  • Ron McLeod
  • Paul Clapham
  • Liutauras Vilda
Sheriffs:
  • paul wheaton
  • Rob Spoor
  • Devaka Cooray
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Tim Moores
Bartenders:
  • Mikalai Zaikin

Co-ordinates or similar in a HTML doc?

 
Ranch Hand
Posts: 54
Android
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Is it possible to display an image on a html page using co-ordinates? Like I have an array of objects with x and y co-ordinate values and I want to loop through each object and use those values to determine the position of an image that will be created for that object on a web page?

I've been looking at imagemaps and a friend of mine said it can be done in jQuery but I'm not sure what would be the "best" way of going about it.

 
Sheriff
Posts: 67746
173
Mac Mac OS X IntelliJ IDE jQuery TypeScript Java iOS
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Using absolute positioning, it's easy to set and find the coordinates of any element. But that's rare. When "normal" web layout is used, the elements end up wherever the layout manager puts them. In these cases, it is a tiresome job to find out where they ended up. That's probably why the suggestion for jQuery -- it has methods that do all the gnarly work for you.

What is it you are actually trying to accomplish?
 
Sean Michael Hayes
Ranch Hand
Posts: 54
Android
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Pretty much like I said. The object class will have the co-ordinates. When we load the web page (its a Java EE project) it will cycle through the objects and for each, we shall add an image to the page with an id of the objects name string variable. When the user clicks on one image, the values of the object (other ones in the class, not co-ordinates) will be displayed.

This is just a plan at the moment, a feature to add to my current project.
 
Consider Paul's rocket mass heater.
reply
    Bookmark Topic Watch Topic
  • New Topic