[Javascript] Detect overlapping controls?

Richard nomorebull at charter.net
Thu Feb 3 23:21:09 CST 2005


If I understand you correctly, yes.
Position:absolute is defined from the appropriate corner of the window.
Whereas, relative is define from within the current block, such as a
division.
To define your starting point, you have four choices, top-left; top-right;
bottom-left; bottom-right.
Some people make the mistake of defining all four positions which only
confuses the browser.
eg. div.sample {position:absolute; top:100px; left:50px;}
NOT position:aboslute; top:100px; left:100px; bottom:100px; right 100px;}
This may be a lame attempt at trying to center the box when there is another
method for doing that.
There is also another element/attribute you can play with as well.
Z-index.
Create a block, place an image in it using position:aboslute, give the
z-index a value and see what happens when text is in the same block.

If this isn't what you had in mind, please clarify.



>
>  Is it possible, with an absolutely-positioned element, to
> determine what controls (either absolutely or relatively positioned)
> overlap its current area?
>
> TIA,
>
> Peter
>
>
> _______________________________________________
> Javascript mailing list
> Javascript at LaTech.edu
> https://lists.LaTech.edu/mailman/listinfo/javascript




More information about the Javascript mailing list