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.getEle mentById("layer ID").style.to p;
leftpos = document.getEle mentById("layer ID").style.left ;
but leftpos and toppos always come back blank.
Thanks in advance!
Billy
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.getEle mentById("layer ID").style.to p;
leftpos = document.getEle mentById("layer ID").style.left ;
but leftpos and toppos always come back blank.
Thanks in advance!
Billy
Comment