Code Newbie
News     Forums     Search     Members     Sign Up    

My Code Newbie
Username

Password

Articles/Snippets
ASP Classic
ASP.NET
C
C#
C++
HTML / CSS
Java
Javascript
Linux / BSD
Perl
PHP
Python
Ruby
SQL
VB 6
VB.NET

C.N. Friends
  Planet Rome

Link to Us!
Code Newbie
  Code Newbie
    forums
Old 11-03-2004, 09:10 AM   #1 (permalink)
buchannon
Registered User
 
buchannon's Avatar
 
Join Date: Nov 2004
Posts: 43
buchannon is on a distinguished road
Changing all the Text Size on a page

I'm trying to let the users that visit my website change the size of text on it via a dropdown menu, or links or whatever. Like this page on the top right corner:

http://www.section508.gov/

I know if I want to change, text color for instance I could use this:
<a href="#" onClick="document.bgColor='yellow';">Yellow!</a>
but how can I change the size of all the text? Thanks!
buchannon is offline   Reply With Quote
Old 11-03-2004, 09:35 AM   #2 (permalink)
sde
Moderator
 
sde's Avatar
 
Join Date: May 2002
Location: us.ca
Posts: 4,446
sde is on a distinguished road
not sure there is a document attribute for that. you may have to make a div tag with an id, and use a style attribute. check out this link for other document stuff:

http://www.devguru.com/Technologies/.../document.html

i see you're using cold fusion, .. why don't you just make that form submit and create session variables or set cookies for the user preference. then you can just code those values into your style sheet.
__________________
Mike
sde is offline   Reply With Quote
Old 11-03-2004, 09:52 AM   #3 (permalink)
buchannon
Registered User
 
buchannon's Avatar
 
Join Date: Nov 2004
Posts: 43
buchannon is on a distinguished road
The site I liked to is not my own, that form is something I'm trying to replicate.

I couldn't find anything on that link to alter the size of text on a page... but I bookmarked it for future DOM reference, thanks!

I have a <div id="blabla"> tag in my code, but how can I alter it? I guess that is my main question. Thanks and sorry for my n00bness.
buchannon is offline   Reply With Quote
Old 11-03-2004, 10:06 AM   #4 (permalink)
sde
Moderator
 
sde's Avatar
 
Join Date: May 2002
Location: us.ca
Posts: 4,446
sde is on a distinguished road
honestly i tried and was going to suggest that, but it didn't work.

i tried something like this ( this doesn't work totally )
HTML Code:
<html>
<body>
<script language=javascript>
document.getElementById('test').style.font-size=20px;
</script>
<div id='test'>
testing 1 2 3 
</div>
</body>
</html>
now if you try some other attributes besides font-size, it works, .. i.e. document.getElementById('test').style.visibility=' hidden';

go figure, .. i don't know. let us know if you figure it out.
__________________
Mike
sde is offline   Reply With Quote
Old 11-03-2004, 11:45 AM   #5 (permalink)
buchannon
Registered User
 
buchannon's Avatar
 
Join Date: Nov 2004
Posts: 43
buchannon is on a distinguished road
The only thing I've come across so far is to use Java Script to do it. This link has code made already but being the idiot I am, I can't get it to work either... <sigh>

http://www.dyn-web.com/dhtml/sizefont/fontsizer.html?18
buchannon is offline   Reply With Quote
Old 11-03-2004, 01:15 PM   #6 (permalink)
buchannon
Registered User
 
buchannon's Avatar
 
Join Date: Nov 2004
Posts: 43
buchannon is on a distinguished road
Ah just a little syntax error... finally got the basic part of this going:
Quote:
document.getElementById('test').style.font-size=20px;
should be:
document.getElementById('test').style.fontSize='20 px';

and that changes it. But for some reason it doesn't work in tables, like if I have the <div id="bla"> before the table I want to be enlarged, and the </div> tag after, it doesn't change the table at all....
buchannon is offline   Reply With Quote
Reply

Bookmarks

Thread Tools
Display Modes

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 On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
refresh page automaticlly lampoin HTML, XML, Javascript, AJAX 5 06-18-2004 08:13 AM
[MySQL] blob vs text redhead PHP 2 03-29-2004 11:15 PM


All times are GMT -8. The time now is 02:06 AM.


Powered by vBulletin® Version 3.7.0
Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
Search Engine Optimization by vBSEO 3.0.0 RC8





Copyright © 2000-2008, Milano Interactive
Web Hosting provided by Portal 360 Web Hosting