Getting Layer's Top and Left
Hi
Friends i have a css style with the following parameters.
#map{
float: left;
width: 451px;
height: 307px;
padding: 7px;
}
then i have a DIV with the ID of "map"
now i want the browser to show me the TOp and LEFT parameters of the DIV when the page is shown in the browser.
like i want to do like this :
<script>
var mapTop = document.getElementById( "map").style.top;
var mapLeft = document.getElementById( "map").style.left;
alert(mapTop);
</script>
but it a BLANK ALERT BOX
plz help
Last edited by zeeshanhashmi; Apr 5, 2007 at 08:05 .
Reason: correction
You can only access the CSS properties set in the style tag or set with JavaScript. To get the correct values set in the CSS file or any computed value you can use the following function .
i do not want to know the CSS property. I want the POSITION of a LAYER on SCREEN.
Which is exactly what that function does... It will get the position or whatever property you want.
Posting Permissions
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts
Forum Rules
Bookmarks