Hello and welcome to our community! Is this your first visit?
Register
Enjoy an ad free experience by logging in. Not a member yet? Register.
Results 1 to 8 of 8
  1. #1
    Regular Coder
    Join Date
    Jun 2007
    Posts
    145
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Button for Increase font size

    Hey!

    If you navigate to http://www.new.3genergi.co.uk

    username:newsite
    password:123newsite

    Notice the mini toolbar just above each pages content - with the two arrows and the A+ and A-.

    I want the A+ and A- to automatically increase and decrease the text size of all elements on the page. Having tried a couple and not being able to get them to work - does anybody have any they can recommend - thanks

    Also how will I use them i have an image map setup atm as follows:

    <area shape="rect" coords="0,0,40,35" href="javascript:history.go(-1);">

    so i presume i can do javascript:function();">

    Thanks guys

    Andy

  • #2
    ess
    ess is offline
    Regular Coder
    Join Date
    Oct 2006
    Location
    United Kingdom
    Posts
    866
    Thanks
    7
    Thanked 30 Times in 29 Posts

  • #3
    Regular Coder
    Join Date
    Jun 2007
    Posts
    145
    Thanks
    0
    Thanked 0 Times in 0 Posts
    with a bit of a push and modding this will settle in fine - nice script seen it before but didnt take the time to understand / implement it.

    Having done that its looking quite nice... nearly!

  • #4
    The fat guy next door VIPStephan's Avatar
    Join Date
    Jan 2006
    Location
    Halle (Saale), Germany
    Posts
    8,635
    Thanks
    6
    Thanked 1,003 Times in 976 Posts
    I don’t know… I think to separate style from functionality (which is the preferred way) it would probably be better to do this with some kind of stylesheet switcher. That means you have different stylesheets with different font sizes and with JavaScript you just switch the stylesheets, i.e. the font sizes. That’s not only cleaner, it’s also a lot easier to maintain.

  • #5
    Regular Coder Karen S. Garvin's Avatar
    Join Date
    Nov 2006
    Location
    Maryland
    Posts
    227
    Thanks
    5
    Thanked 2 Times in 2 Posts
    That means you have different stylesheets with different font sizes and with JavaScript you just switch the stylesheets
    I understand why you'd use different stylesheets, but wouldn't using a JavaScript to change between them be a problem for broswsers that weren't allowing JavaScript? I surf with NoScript turned on at work, so I'm always having to "allow script." It's a pain, but it keeps my work machine clean (I think it does, anyway! )

    Anyway, could the same thing be accomplished with a PHP script? Wouldn't that be better tolerated by browsers?
    ----------------------------------------------
    Karen S. Garvin
    http://ksgarvin.wordpress.com

  • #6
    Regular Coder
    Join Date
    Jun 2007
    Posts
    145
    Thanks
    0
    Thanked 0 Times in 0 Posts
    Yea im sure it could, except in php it can sometimes be a haslte getting it to function alongside a CMS - like im using.

  • #7
    The fat guy next door VIPStephan's Avatar
    Join Date
    Jan 2006
    Location
    Halle (Saale), Germany
    Posts
    8,635
    Thanks
    6
    Thanked 1,003 Times in 976 Posts
    Well, my philosophy is (and this is where "graceful degradation" comes into the game) that there would always be a standard style/font size and the buttons to change the size (switch the stylesheets) would be generated by JS, too, so effectively this means if you have JS disabled you won't even see any option to resize the text on the page itself (you'd still be able to use the browser's built-in function). After all, this is only an additional feature and not required to read the page.

    With PHP there would be additional requests to the server and the page is reloaded entirely which will increase the necessary bandwidth and make such a simple feature really bloated, I guess.

  • #8
    Regular Coder Karen S. Garvin's Avatar
    Join Date
    Nov 2006
    Location
    Maryland
    Posts
    227
    Thanks
    5
    Thanked 2 Times in 2 Posts
    I wonder what else I'm not seeing with the NoScript turned on.

    I routinely use the browser's ability to increase font size when I'm reading online for any length of time, but it sometimes breaks the page. Other times it just turns into elephant-sized text and is ridiculously large to try and read. Where I've seen the option to change point size on a site it usually works much nicer.
    ----------------------------------------------
    Karen S. Garvin
    http://ksgarvin.wordpress.com


  •  

    Posting Permissions

    • You may not post new threads
    • You may not post replies
    • You may not post attachments
    • You may not edit your posts
    •