Previous Message
Next Message

[css-d] Text size switcher

Sent by masadelante on 3 May 2003 03:03


Hello List,    (my apologies if this has been mentioned and discussed
already)
 
Having checked out some of the style-switchers that are of vogue lately,
I have noticed that there are more direct methods of CSS attribute
switching out there, methods that don't require you to download several
style-sheets and a JS switcher to boot. One of the nicest I have seen is
that at www.cinnamon.nl <http://www.cinnamon.nl/> . I got around to
experimenting with a few methods and am posting them here:
http://www.masadelante.com/css/sizeswap.htm
 
There are two methods employed. The first one (and the coolest in my
mind) involves the T+ and T-, similar to the 'cinnamon switcher'. I say
'similar' because the result is the same but the path was a bit
different!! I am a JavaScript novice, and I couldn't figure out their
code - and if I can't reverse engineer it, I shouldn't be using it!
 
Back to the buttons.If you give the buttons a few clicks you can see it
in action. There are good notes in the script if you want the details,
but what the script does is 'write' a new pixel size to the
body-font-size attribute. The other tags - h1, h2, p etc. - are set with
em's and resize accordingly. If you hit the refresh button, the 'base
font size' will refresh and you can see the size that is currently
stored in the cookie.
 
The second example uses a different method, and in my mind isn't as
slick as the first - however it can be achieved with inline code, and
little at that.
 
Both of these methods can tweak more than just font-size, and if you
only want to change three or four attributes, it may be worth the
bandwidth to try one of these rather than download three or four
style-sheets. If you are using the switcher you are already using more
JavaScript than there is here. 
 
I was wondering what all you list goers think of this? I have no idea if
it works in Macintosh. Opera 6 is out, and 7 required a workaround to
keep it from spilling its lunch on my screen. IE and Netscape (no, not
nn4!) seem to like it. I would appreciate any ideas or feedback you all
may have on this. I'll post when it's 'final' so that those who find it
useful can put it to work!!
 
Regards,
Mike
www.masadelante.com <http://www.masadelante.com/> 
 
______________________________________________________________________
css-discuss [EMAIL-REMOVED]]
http://www.css-discuss.org/mailman/listinfo/css-d
Supported by evolt.org -- http://www.evolt.org/help_support_evolt/
Previous Message
Next Message

Message thread: