Groups > Browsers > Opera page authoring > Re: Javascripted style changes in Opera 9.02




Javascripted style changes in Opera 9.02

Javascripted style changes in Opera 9.02
Thu, 12 Oct 2006 09:59:28 +020
Greetings,

I've created a low-tech Post-it Notes Generator. It uses some javascript  
to change the style set on a textarea element. This works as expected in  
MSIE and FF, but only partially in Opera 9.02 (seen on both Windows 2003  
Server and XP Home edition so far).

Specifically these parts don't work as expected:

- The font selector doesn't change the font family  
(document.getElementById('theNoteText').style.fontFamily=this.value; using  
quoted names of font families.)

- The font size selector doesn't seem to change font size but line height
(document.getElementById('theNoteText').style.fontSize=this.value; using  
x-large, medium, etc.)

- The italics selector doesn't seem to have any effect
(document.getElementById('theNoteText').style.fontStyle=this.value; using  
italic, normal.)

- The only thing that does work is the alignment selector
(document.getElementById('theNoteText').style.textAlign=this.value; using  
left, right, justify, center.)


The starting style for the textarea element is set in the stylesheet block  
in the page header.

Am I missing something?

-- 
Yours,
ΩJr

Post Reply
Re: Javascripted style changes in Opera 9.02
Thu, 12 Oct 2006 10:01:33 +020
On Thu, 12 Oct 2006 09:59:28 +0200, OmegaJunior  
<omegajunior@spamremove.home.nl> wrote:

> Greetings,
>
> I've created a low-tech Post-it Notes Generator. It uses some javascript  
> to change the style set on a textarea element. This works as expected in  
> MSIE and FF, but only partially in Opera 9.02 (seen on both Windows 2003  
> Server and XP Home edition so far).
>
> Specifically these parts don't work as expected:
>
> - The font selector doesn't change the font family  
> (document.getElementById('theNoteText').style.fontFamily=this.value;  
> using quoted names of font families.)
>
> - The font size selector doesn't seem to change font size but line height
> (document.getElementById('theNoteText').style.fontSize=this.value; using  
> x-large, medium, etc.)
>
> - The italics selector doesn't seem to have any effect
> (document.getElementById('theNoteText').style.fontStyle=this.value;  
> using italic, normal.)
>
> - The only thing that does work is the alignment selector
> (document.getElementById('theNoteText').style.textAlign=this.value;  
> using left, right, justify, center.)
>
>
> The starting style for the textarea element is set in the stylesheet  
> block in the page header.
>
> Am I missing something?
>

A link would probably help:

http://xentor.mysticwicks.com/post-its/

-- 
Yours,
ΩJr

Post Reply
Re: Javascripted style changes in Opera 9.02
Fri, 13 Oct 2006 02:44:14 -040
> Basically the only thing that does seem to work is the outlining.

I have verified that as well. However, the fonts are not accurate in FF. I 
select one font, but the text is styled with a different font. For example, 
selecting Blackadder displays the text in Comic Sans MS. Perhaps this is 
just the generic font family because I don't have Blackadder, however when I 
select Comic Sans MS, the text is displayed in some other font.


Tim 

Post Reply
Re: Javascripted style changes in Opera 9.02
Fri, 13 Oct 2006 08:13:12 +020
On Thu, 12 Oct 2006 10:01:33 +0200, OmegaJunior  
<omegajunior@spamremove.home.nl> wrote:

> On Thu, 12 Oct 2006 09:59:28 +0200, OmegaJunior  
> <omegajunior@spamremove.home.nl> wrote:
>
>> Greetings,
>>
>> I've created a low-tech Post-it Notes Generator. It uses some  
>> javascript to change the style set on a textarea element. This works as
 
>> expected in MSIE and FF, but only partially in Opera 9.02 (seen on both
 
>> Windows 2003 Server and XP Home edition so far).
>>
>> Specifically these parts don't work as expected:
>>
>> - The font selector doesn't change the font family  
>> (document.getElementById('theNoteText').style.fontFamily=this.value;  
>> using quoted names of font families.)
>>
>> - The font size selector doesn't seem to change font size but line  
>> height
>> (document.getElementById('theNoteText').style.fontSize=this.value;  
>> using x-large, medium, etc.)
>>
>> - The italics selector doesn't seem to have any effect
>> (document.getElementById('theNoteText').style.fontStyle=this.value;  
>> using italic, normal.)
>>
>> - The only thing that does work is the alignment selector
>> (document.getElementById('theNoteText').style.textAlign=this.value;  
>> using left, right, justify, center.)
>>
>>
>> The starting style for the textarea element is set in the stylesheet  
>> block in the page header.
>>
>> Am I missing something?
>>
>
> A link would probably help:
>
> http://xentor.mysticwicks.com/post-its/
>

I've been changing the code based on examples I've seen on the net, and  
even tried the setAttribute('style',...), but that didn't work either.

I've also started using css property names as well as their javascript  
counterparts, and that didn't work either.

Basically the only thing that does seem to work is the outlining.

-- 
Sincerely,
ΩJr

Post Reply
Re: Javascripted style changes in Opera 9.02
Fri, 13 Oct 2006 09:12:05 +010
OmegaJunior <omegajunior@spamremove.home.nl> wrote:

>I've created a low-tech Post-it Notes Generator. It uses some javascript  
>to change the style set on a textarea element. This works as expected in  
>MSIE and FF, but only partially in Opera 9.02 (seen on both Windows 2003  
>Server and XP Home edition so far).
>
>Specifically these parts don't work as expected:
>
>- The font selector doesn't change the font family  
>(document.getElementById('theNoteText').style.fontFamily=this.value; using 

>quoted names of font families.)

Apparently Opera doesn't allow certain styling properties of form
elements to be changed through scripting. This is not new, it applies to
all versions of Opera.

The CSS2.1 spec states that "CSS2.1 does not define which properties
apply to form controls and frames, or how CSS can be used to style them.
User agents may apply CSS properties to these elements. Authors are
recommended to treat such support as experimental. A future level of CSS
may specify this further."

-- 
Post Reply
<< Previous 1 2 Next >>
( Page 1 of 2 )
about | contact