aaron1a12
06-02-2010, 10:58 PM
Hi guys, I'd like to any if anybody has any ideas on how to "Detecting Relative Positions in Javascript?"
I mean like having a main DIV and a secondary DIV and then detect the position of the secondary DIV relative to the main DIV. Something like "top-right", "bottom-left", "top", "bottom".
Then, is there a way to execute a specific action for each result? Like so:
if position = top-left, then execute top-left();
if position = bottom-right, then execute bottom-right();
Is this possible in JavaScript?
I mean like having a main DIV and a secondary DIV and then detect the position of the secondary DIV relative to the main DIV. Something like "top-right", "bottom-left", "top", "bottom".
Then, is there a way to execute a specific action for each result? Like so:
if position = top-left, then execute top-left();
if position = bottom-right, then execute bottom-right();
Is this possible in JavaScript?