CSS Absolut position and nesting problem
Hello,
I have a page that has a centered div with the pages main content. When a user clicks on something I display a hidden div where they clicked (or atleast it is supposed to). The problem is that I am getting the X and Y coordinates from the browser and not the parent div so the place that the div shows up is way off on browsers with large screen sizes (the page is centered). It is exactly where it needs to be of the main content takes up the whole page (1024x768).
My question is, is there any way to get the x and y coordinates from the current parent div instead of the browser? Or is there any way to tell my new layer to use the body parent instead of its parent layer?
I just thought of another thing i could do but it would require reliably getting the viewable browser width. Do you know how to do this?
I forgot to mention that am am doing this with Javascript (if you werent't already able to tell)
Thanks
|