Re: HOW TO: Create Style/Class Elements Programmaticall y
gsb wrote:
[color=blue]
> Is there a way to create, say createElement( "STYLE"), to create new classes
> or style sheets from within JavaScript?[/color]
Re: HOW TO: Create Style/Class Elements Programmaticall y
gsb wrote:[color=blue]
> Is there a way to create, say createElement( "STYLE"), to create new classes
> or style sheets from within JavaScript?
>
> Thanks,
>
> gsb
>
>[/color]
To create a new stylesheet:
var AccessibilitySt yleSheet = document.create StyleSheet("Acc essibility
style sheet", "projection,scr een,tv");
For the general syntax, see:
The methods given are standard W3C DOM 2 CSS methods. You should expect
only recent browsers (like Mozilla 1.5+, Opera 7.5, Safari 1.2,
Konqueror 3.2) to support these W3C methods: untested and unverified.
MSIE uses different methods.
Re: HOW TO: Create Style/Class Elements Programmaticall y
gsb wrote:[color=blue]
> Is there a way to create, say createElement( "STYLE"), to create new classes
> or style sheets from within JavaScript?[/color]
Re: HOW TO: Create Style/Class Elements Programmaticall y
DU wrote:[color=blue]
> gsb wrote:
>[color=green]
>> Is there a way to create, say createElement( "STYLE"), to create new
>> classes
>> or style sheets from within JavaScript?
>>
>> Thanks,
>>
>> gsb
>>
>>[/color]
>
>
> To create a new stylesheet:
>
> var AccessibilitySt yleSheet = document.create StyleSheet("Acc essibility
> style sheet", "projection,scr een,tv");[/color]
DU
[color=blue]
> For the general syntax, see:
> http://www.w3.org/TR/2000/REC-DOM-Le...eet-insertRule
>
>
> The methods given are standard W3C DOM 2 CSS methods. You should expect
> only recent browsers (like Mozilla 1.5+, Opera 7.5, Safari 1.2,
> Konqueror 3.2) to support these W3C methods: untested and unverified.
> MSIE uses different methods.
>
> DU[/color]
Re: HOW TO: Create Style/Class Elements Programmaticall y
DU wrote:
[color=blue]
> DU wrote:
>[color=green]
>> gsb wrote:
>>[color=darkred]
>>> Is there a way to create, say createElement( "STYLE"), to create new
>>> classes
>>> or style sheets from within JavaScript?[/color]
>>
>> To create a new stylesheet:
>>
>> var AccessibilitySt yleSheet = document.create StyleSheet("Acc essibility
>> style sheet", "projection,scr een,tv");[/color]
>
>
> It should have been written rather
>
> var AccessibilitySt yleSheet =
> document.create CSSStyleSheet(" Accessibility style sheet",
> "projection,scr een,tv");
>[/color]
No, it should be
document.implem entation.create CSSStyleSheet(. .., ...)
but that is not supported by Mozilla or other browsers and wouldn't help
as the DOM spec itself admits that there is no way to associate the
created stylesheet with a document.
--
Re: HOW TO: Create Style/Class Elements Programmaticall y
Thanks all.
Looks like I can get it to work.
gsb
"gsb" <gsb@QWest.ne t> wrote in message
news:f5zYb.145$ 9B3.51516@news. uswest.net...[color=blue]
> Is there a way to create, say createElement( "STYLE"), to create new[/color]
classes[color=blue]
> or style sheets from within JavaScript?
>
> Thanks,
>
> gsb
>
>[/color]
Comment