[Javascript] Apply padding via javascript
Abyss - Information
Info at Abyss.ws
Sat Aug 19 19:20:18 CDT 2006
Thank you for the response...I realised that after a about 4 hours of
digging around google :)
I appreciate the response though
----- Original Message -----
From: "Scott Reynen" <scott at randomchaos.com>
To: "[JavaScript List]" <javascript at LaTech.edu>
Sent: Sunday, August 20, 2006 8:12 AM
Subject: Re: [Javascript] Apply padding via javascript
> On Aug 19, 2006, at 1:29 AM, Abyss - Information wrote:
>
>> Hi all
>>
>> If I wanted to add padding to a div tag after I found the screen
>> resolution via Javascript
>>
>> what would be the best out of the following 2 options?
>>
>> document.all.MyBlock.style
>> or
>> document.layers['MyBlock'].style
>
> As I understand it, both document.all and document.layers are browser-
> specific, with document.all working in IE4 and document.layers working in
> Netscape 4. So which is "best" depends on which of those obsolete
> browsers you're looking to support. But unless you have some special
> circumstances, the best would probably be to use the standard supported
> by "every Javascript supporting browser released since 1998" [1]:
>
> document.getElementById( 'MyBlock' ).style
>
> [1] http://simon.incutio.com/archive/2003/08/11/documentAll
>
> Peace,
> Scott
> _______________________________________________
> Javascript mailing list
> Javascript at LaTech.edu
> https://lists.LaTech.edu/mailman/listinfo/javascript
>
More information about the Javascript
mailing list