![]() | |
![]() |
| | Thread Tools | Display Modes |
#1
| |||
| |||
|
#2
| |||
| |||
|
|
Hi, I was wondering how to retrieve the cordinates of a CSS layer with javascript. |
#3
| |||
| |||
|
|
Is getComputedStyle something for you? Sample article: http://www.csie.ntu.edu.tw/~b7506051...examples7.html |
#4
| |||
| |||
|
|
Hi, I was wondering how to retrieve the cordinates of a CSS layer with javascript. I set the layer cordinates as like this in the header: style type="text/css" .classID { position: absolute; left: 2px; top: 100px; } /style then in the body I have: div id="layerID" class="classID" some html and text /div The layer positions properly so I know that works. and then in a javascript function I try to retrieve the cordinates by: toppos = document.getElementById("layerID").style.top; leftpos = document.getElementById("layerID").style.left; but leftpos and toppos always come back blank. |
|
Thanks in advance! Billy |
#5
| |||
| |||
|
|
Billy wrote: Hi, I was wondering how to retrieve the cordinates of a CSS layer with javascript. Is getComputedStyle something for you? Sample article: http://www.csie.ntu.edu.tw/~b7506051...examples7.html |
![]() |
| Thread Tools | |
| Display Modes | |
| |