Tycoon Talk
Become a Big fish!
The number 1 forum for online business!
Post topics, ask questions, share your knowledge.
Tycoon Talk is part of Freelancer.com - find skilled workers online at a fraction of the cost.

JavaScript Forum


You are currently viewing our JavaScript Forum as a guest. Please register to participate.
Login



Reply
Old 04-06-2005, 11:00 AM Changing Font Size
Super Talker

Posts: 121
Trades: 0
Ive seen these on lots of websites in the past, and i think ithey seem like a very good idea for creating more accessible websites,but how do you control the size of text using javascript?

the idea i had was to change the class of the layer and set a cookie, im not sure if this can be doen but i dont see why it couldnt be done, can anyone tell me if this can be done or if there is a better way of doing it?
vegancoder is offline
Reply With Quote
View Public Profile
 
 
Register now for full access!
Old 04-06-2005, 12:53 PM
pencer's Avatar
Extreme Talker

Posts: 179
Location: Nottingham UK
Trades: 0
You don't need to use Javascript to change the size of the font on your website. Instead use CSS, have a different style sheet for each font size and have links on your website to the different sheets.

Someone on here did a site like this recently: http://nabialek.it.aplus.pl/
__________________
Upto 90% of all home computers are infected with Spyware.
Please login or register to view this content. Registration is FREE


Making money online is easy when you know
Please login or register to view this content. Registration is FREE

pencer is offline
Reply With Quote
View Public Profile Visit pencer's homepage!
 
Old 04-06-2005, 02:17 PM
Super Talker

Posts: 121
Trades: 0
do you know how he makes the preferences stay the same? throught out the the site once you have changed them?
vegancoder is offline
Reply With Quote
View Public Profile
 
Old 04-06-2005, 04:18 PM
dk01's Avatar
Ultra Talker

Posts: 373
Location: Ames, IA
Trades: 0
Hey is using php to setup cookies. Cookies store information on a users computer for when they come back to the site. You can do cookies in php or javascript. Javascript can be done by anyone, php is only for users with php enabled on their webserver.

You can read here about php and cookies:
http://us2.php.net/manual/en/function.setcookie.php

You can read here for information about javascript and cookies:
http://www.webreference.com/js/column8/

-dk
__________________
Did I help you? If so, be nice and throw me some
Please login or register to view this content. Registration is FREE


Please login or register to view this content. Registration is FREE
-
Please login or register to view this content. Registration is FREE
dk01 is offline
Reply With Quote
View Public Profile
 
Old 04-06-2005, 06:20 PM
drewrockshard's Avatar
Super Talker

Posts: 100
Name: Drew
Location: Garland (Dallas), Texas
Trades: 0
i would use the DOM and javascript to do this...alot faster and not much programming.
__________________
Best Regards,
Drew Decker

Please login or register to view this content. Registration is FREE
drewrockshard is offline
Reply With Quote
View Public Profile
 
Old 04-06-2005, 07:21 PM
pitbull82's Avatar
Super Talker

Posts: 147
Name: Marcin Nabiałek
Location: Poland, Częstochowa
Trades: 0
Nice to see that you mention my site

In my site I'm using only PHP to setup, save and restore preferences. The reason is simple - if someone had js turned off, he would't see the effects.

Hovewer, the first try was using combination JS and PHP but I've resigned and noe using only PHP.

If you have PHP enabled you can simple create rule for font-size (that's in my code) -
Code:
<style> body {font-size: xxxpx;} </style>
if someont clicks + you simply do +$xxx; and write it in the code via PHP.

To restore the preferences, I've used COOKIES although the site mainly uses sessions...
__________________

Please login or register to view this content. Registration is FREE
|
Please login or register to view this content. Registration is FREE
|
Please login or register to view this content. Registration is FREE
pitbull82 is offline
Reply With Quote
View Public Profile Visit pitbull82's homepage!
 
Reply     « Reply to Changing Font Size
 

Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are Off
Pingbacks are Off
Refbacks are Off





   
RSS Feed  Feeds: RSS   JS   XML
RSS Feed  Feeds for this forum: RSS   JS   XML



Page generated in 0.16551 seconds with 12 queries