I'm trying to write a javascript function that 'slides' a page a bit down by
retreiving the current top-margin of the body, and then setting it to the
old margin + 50px extra..
The problem here is, I can't seem to retreive the current margin.
Here's what I use now (which returns an empty value):
<html>
<style> body { background-color: yellow; margin-top: 100px; }</style>
<body>
<script language='javas cript'>
document.write( 'current margin: ' + document.body.s tyle.marginTop) ;
</script>
</body>
</html>
Any ideas?
retreiving the current top-margin of the body, and then setting it to the
old margin + 50px extra..
The problem here is, I can't seem to retreive the current margin.
Here's what I use now (which returns an empty value):
<html>
<style> body { background-color: yellow; margin-top: 100px; }</style>
<body>
<script language='javas cript'>
document.write( 'current margin: ' + document.body.s tyle.marginTop) ;
</script>
</body>
</html>
Any ideas?
Comment