On Jul 5, 11:44 am, joj...@gmail.com wrote:
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