can u find pixel coords of elements given only html

J

jojoba

Hi
I am trying to determine coordinates of something in a webpage.
All i have is a subset of html that i know exists in a given webpage.
Now i want to find that subsetHtml in the page and determine the exact
pixel coordinates for the elements that subsetHtml comprises.
I'm pretty sure i know how to get the pixel coords once i have the
elements.
The hard part is going from plain HTML to actual elements.
Any ideas
thx,
jojoba
 
P

Peter Michaux

Hi
I am trying to determine coordinates of something in a webpage.
All i have is a subset of html that i know exists in a given webpage.
Now i want to find that subsetHtml in the page and determine the exact
pixel coordinates for the elements that subsetHtml comprises.
I'm pretty sure i know how to get the pixel coords once i have the
elements.

Cross-browser computation of pixel location of an element in a web
page is an unsolved problem, in general. It can be done in many
particular cases but it is usually not easy and needs to be tested in
many browsers. Why do you need to know the pixel location? Luckily, I
haven't run into a situation where I need the pixel location of an
element except in the really simple cases where the usual offsetParent
walk up the DOM works.
The hard part is going from plain HTML to actual elements.

If you post a small example then people can help better. Hopefully one
of the HTML elements of interest has a unique id attribute.

Peter
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,744
Messages
2,569,484
Members
44,903
Latest member
orderPeak8CBDGummies

Latest Threads

Top