[Javascript] Changing the font of all elements on a page [Spam][93.0%]

Javier javier at viventura.de
Thu Nov 25 14:25:39 CST 2004


Hi Paul:


var actual_fontsize   = 13;
var smallest_fontsize = 11;
var largest_fontsize  = 20;


function Bigger() {
  actual_fontsize = actual_fontsize+1;
  if (actual_fontsize > largest_fontsize) { actual_fontsize =
largest_fontsize }
  ChangeProp('text','','style.fontSize',actual_fontsize,'SPAN');
  ChangeProp('text2','','style.fontSize',actual_fontsize,'SPAN');
}

function Smaller() {
  actual_fontsize = actual_fontsize-1
  if (actual_fontsize < smallest_fontsize) { actual_fontsize =
smallest_fontsize }
  ChangeProp('text','','style.fontSize',actual_fontsize,'SPAN');
  ChangeProp('text2','','style.fontSize',actual_fontsize,'SPAN');
}


Javier



Thursday, November 25, 2004 9:06 AM
Paul Cowan <dagda1 at hotmail.com>:

> Flavio,
>
> I am very aware of stylesheets.
>
> It's a complex problem needing me to change font-size on the browser
> and not when the page is rendered.
>
> OK let me simplify the question.
>
> How do I change the font-size in an element.
>
> I'd rather not change the element element class name
>
> i.e. element.style.class = 'differentFont';
>
> Any ideas
>
>
>
> dagda1 at hotmail.com
>
>
>
>
>> From: Flavio Gomes <flavio at economisa.com.br>
>> Reply-To: "[JavaScript List]" <javascript at LaTech.edu>
>> To: "[JavaScript List]" <javascript at LaTech.edu>
>> Subject: Re: [Javascript] Changing the font of all elements on a page
>> Date: Thu, 25 Nov 2004 14:04:20 -0200
>>
>>
>> Dinamically?
>>
>>    If not you can try researching on CSS Style Sheets.
>>
>> --
>> Flavio Gomes
>> flavio at economisa.com.br
>>
>> Paul Cowan wrote:
>>
>>> Hi all,
>>>
>>> Is anyone aware how I can change of all the input tags on a page??
>>>
>>> Thanks
>>>
>>> Paul
>>
>> _______________________________________________
>> Javascript mailing list
>> Javascript at LaTech.edu
>> https://lists.LaTech.edu/mailman/listinfo/javascript
>
>
> _______________________________________________
> Javascript mailing list
> Javascript at LaTech.edu
> https://lists.LaTech.edu/mailman/listinfo/javascript




More information about the Javascript mailing list