Posts: 256
Location: Auckland, New Zealand
|
I actually prefer using getElementsByTagName, though that would have been due to the lack of support for getElementById at the time.
Why can't you change the width on body?
Cause I know you can.
Is it an IE problem?
If so I didn't know this, but it's quite rare that I would change body width, I usually create fluid sites.
HTML Code:
... in head ...
<script type="text/javascript">
/*<![CDATA[*/
function increaseWidth()
{
var body = document.getElementsByTagName.item(0);
body.style.width = 600px // size you want body to increase to
}
/*]]>*/
</script>
... in body (link must go inside a block level element) ...
<a href="#" onclick="javascript:increaseWidth();" >Increase page width</a>
Though Javascript will not be able to read CSS/Browser default styles used (it can read width from the attribute style), but it can grab the size from the browser and use that as a basis for what the size is if you need to work on actually incrementing the size.
Cheers,
MC
__________________
#------------------------------ signature---------------------------------------------------------------------------------#
Quote:
|
I am well recognised for what I don't do than what I do. Chores are just one of those things.
|
Last edited by mastercomputers; 08-07-2006 at 01:13 PM..
|