Hi again,
How would you make a script that displayed an object's X and Y coordinates in a text box?
Say I made a draggable DIV. Each time I let go of it, how would I make a text box or two display where it is on the page? More specifically, the X and Y positions?
What I'm doing is making a website editor. I want it to be a drag n' drop interface, where you drag a DIV around, changing it's size and position, and a text box showing where it is on the page. Like my generators, the generator uses those coordinates to determine the margins for the CSS file is makes.
Something like this, except it outputs 4 values, the Top Right Bottom Left values.
So instead of outputting:
margin: 0px 240px;
it would output:
margin: 0px 120px 0px 120px;
Is there a way to do this? If so, I need it!
Thanks,
Physicsguy
__________________
PGReviews | PGCode
Computer Specs: AMD Phenom II Quad-Core Processor, ASUS M4A785-M Motherboard, ASUS ENGTS250 1G Dark Knight Graphics Card, 4GB OCZ RAM
Last edited by Physicsguy; 06-30-2009 at 06:43 PM..
|