Text Size -> Largest, Larger, Medium, Smaller, Smallest

Discussion in 'Javascript' started by dmsy@yahoo.com, Feb 9, 2005.

  1. Guest

    Is there a way to use javascript to increase the overall document text
    size, just like if you click View->Text Size->Largest, Larger, Medium,
    Smaller, Smallest? This is on IE browser.
     
    , Feb 9, 2005
    #1
    1. Advertising

  2. wrote:

    > Is there a way to use javascript to increase the overall document text
    > size, just like if you click View->Text Size->Largest, Larger, Medium,
    > Smaller, Smallest? This is on IE browser.


    You could dynamically alter the style.fontSize property of the body element
    - but why bother? Browsers already come with a way for the user to choose
    their font size, there's no need to muddy the water by duplicating
    something the browser already does but which works only on one website.

    --
    David Dorward <http://blog.dorward.me.uk/> <http://dorward.me.uk/>
    Home is where the ~/.bashrc is
     
    David Dorward, Feb 9, 2005
    #2
    1. Advertising

  3. Duwayne Sy wrote:

    > I have tried that already and it does not work. It only changes the
    > size of text that does not have a size set. Text with size set by font
    > remains the same.


    <font> is deprecated and should not be used.
    If you specify your font sizes with font-size relative units (% or em are
    typically the best choice) then this isn't an issue.

    > I need something that changes the whole document, just
    > as how the menu items work. I need this functionallity because I am
    > writting a custom browser for internal use. Some users have problems
    > seeing the default text size so they need to be able to resize it.


    So why not add a font size preference to the browser?

    } *** Sent via SPAMSPAMSPAM http://SPAMSPAMSPAMSPAMSPAMSP***
    } Don't just SPAM USENET...get rewarded for it!

    .... while failing to quote properly. Please find a real NNTP service rather
    than this nasty spammy thing.

    --
    David Dorward <http://blog.dorward.me.uk/> <http://dorward.me.uk/>
    Home is where the ~/.bashrc is
     
    David Dorward, Feb 9, 2005
    #3
  4. Randy Webb Guest

    Duwayne Sy wrote:

    > The <font> tag is depricated, but it does not stop anyone from using it.


    Idiots are born every minute.....

    > I have no control how other people author their HTML.


    But since you are developing an "custom browser for internal use" then
    you have control over how your "browser" displays that garbage code.

    > I am not trying to author the HTML, just want to change the size
    > when the users need to see bigger text.


    Then let them use an existing browser that has that built in. Or, code
    your "browser" so that it has a Size> Button or Menu that alters it.

    --
    Randy
    comp.lang.javascript FAQ - http://jibbering.com/faq & newsgroup weekly
     
    Randy Webb, Feb 9, 2005
    #4
  5. Duwayne Sy wrote:

    > The <font> tag is depricated, but it does not stop anyone from using it.
    > I have no control how other people author their HTML. I am not trying to
    > author the HTML, just want to change the size when the users need to see
    > bigger text.


    If you have no control over the webpage, why are you asking how to use
    JavaScript to alter it? JavaScript typically has to be referenced from the
    page!

    --
    David Dorward <http://blog.dorward.me.uk/> <http://dorward.me.uk/>
    Home is where the ~/.bashrc is
     
    David Dorward, Feb 9, 2005
    #5
  6. Duwayne Sy wrote:

    > I am asking because when the HTML is loaded in a typical browser, the
    > DOM model is generated. Since I am reusing IE browser control


    The IE browser control is very limited when it comes to font sizing. For
    example, unless the user's preferences are to ignore all font sizing hits
    whatsoever, any font sizes set using pt or px units will be impossible for
    the user to resize. The only way to get round this is to alter the style
    properties being applied to the element.

    If you want decent font resizing then you should look at using a different
    rendering engine. Gecko for instance.

    --
    David Dorward <http://blog.dorward.me.uk/> <http://dorward.me.uk/>
    Home is where the ~/.bashrc is
     
    David Dorward, Feb 9, 2005
    #6
    1. Advertising

Want to reply to this thread or ask your own question?

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. Sanitarium
    Replies:
    2
    Views:
    554
    Whitecrest
    Dec 4, 2003
  2. Peter Williams
    Replies:
    1
    Views:
    1,440
    Dylan Parry
    Jun 3, 2005
  3. Keke922
    Replies:
    2
    Views:
    3,106
    Shane Beasley
    Nov 2, 2003
  4. Peter Ammon
    Replies:
    13
    Views:
    3,887
    Arin Chaudhuri
    Jun 15, 2004
  5. Code4u
    Replies:
    4
    Views:
    2,684
    Stephen Howe
    Jul 13, 2005
Loading...

Share This Page