Hi there,

I'm busy trying to build an interface where users can create a sort of collage with images that they upload. I know it is possible to get the position of a DHTML element relative to the screen, the problem is I need the coordinates relative to a main div tag so that I can "compile" the collage and then when it gets served it will look the same regardless of screen size.

Thanks in advance for any help

Recommended Answers

All 2 Replies

Then just get the absolute positions of both then subtract the item you want's position from the item that it's relative from.

Box1 : x 100, y 200
Box2 : x 234, y 123
Box2 Relative Box1: x 134, y -77

Thanks Shawn,

Got it working :)

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.