Go Back   Dynamic Drive Forums > General Coding > JavaScript
Search Dynamic Drive Forums:

Reply
 
Thread Tools Search this Thread
  #1  
Old 01-14-2006, 07:08 AM
annies44 annies44 is offline
Junior Coders
 
Join Date: Dec 2005
Posts: 21
Thanks: 0
Thanked 0 Times in 0 Posts
Default renderReadability()

Can anyone give me some info on how to set this up in website... where I can find some code for this?

Thanks
Reply With Quote
  #2  
Old 01-14-2006, 11:35 AM
Twey's Avatar
Twey Twey is offline
Modtoreador
 
Join Date: Jun 2005
Location: 英国
Posts: 11,933
Thanks: 1
Thanked 180 Times in 172 Posts
Blog Entries: 2
Default

Certainly, if you give us some info as to what on earth you're actually trying to do. A single function name isn't much of a giveaway, you know.
__________________
Twey | I understand English | 日本語が分かります | mi jimpe fi le jbobau | mi esperanton komprenas | je comprends français | entiendo español | tôi ít hiểu tiếng Việt | ich verstehe ein bisschen Deutsch | beware XHTML | common coding mistakes | tutorials | various stuff | argh PHP!
Reply With Quote
  #3  
Old 01-14-2006, 11:24 PM
annies44 annies44 is offline
Junior Coders
 
Join Date: Dec 2005
Posts: 21
Thanks: 0
Thanked 0 Times in 0 Posts
Default

No problem.... I want to have the ability for my visitors to enlarge the font size. I saw a website that offered that. They actually had two larger sizes that the people could click on to use. http://abcnews.go.com/Travel/story?id=1486744&page=1

You will notice that it's under the banner at the top on the right-hand side.

Thanks.
Reply With Quote
  #4  
Old 01-15-2006, 12:12 AM
Twey's Avatar
Twey Twey is offline
Modtoreador
 
Join Date: Jun 2005
Location: 英国
Posts: 11,933
Thanks: 1
Thanked 180 Times in 172 Posts
Blog Entries: 2
Default

Most browsers already implement this. In Firefox, it's under View->Text Size.
Nevertheless, this ought to work:
Code:
<a href="javascript:void(0);" onclick="
  var fs = document.body.style.fontSize;
  document.body.style.fontSize = (
    isNaN(parseFloat(fs))
      ? '18pt'
      : (parseFloat(fs) + 2) + fs.substring(parseFloat(fs).toString().length)
    );
">Increase Font Size</a>

<a href="javascript:void(0);" onclick="
  var fs = document.body.style.fontSize;
  document.body.style.fontSize = (
    isNaN(parseFloat(fs))
      ? '18pt'
      : (parseFloat(fs) - 2) + fs.substring(parseFloat(fs).toString().length)
    );
">Decrease Font Size</a>

<a href="javascript:void(0);" onclick="
document.body.style.fontSize = '18pt';
">Default Font Size</a>
Change "18pt" in all links to font sizes better suited to your site as a default. Tested only in Firefox, and that with only a very simple DOM.
__________________
Twey | I understand English | 日本語が分かります | mi jimpe fi le jbobau | mi esperanton komprenas | je comprends français | entiendo español | tôi ít hiểu tiếng Việt | ich verstehe ein bisschen Deutsch | beware XHTML | common coding mistakes | tutorials | various stuff | argh PHP!

Last edited by Twey; 01-15-2006 at 12:48 AM.
Reply With Quote
Reply

Bookmarks

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

Forum Jump


All times are GMT. The time now is 09:46 PM.

Home - Contact Us - Archives - Link to DD - Top 

Powered by vBulletin® Version 3.8.1
Copyright ©2000 - 2009, Jelsoft Enterprises Ltd.