Guest Post: change text size onclick with JavaScript

I have been featured on the David Walsh Blog with a post telling you how to Change Text Size On Click With Javascript. My code and explanation is there, but I do have a nice sample of the script in action.

Share your thoughts in the comments!

Make text bigger | Make text smaller
Lorem ipsum dolor sit amet, consetetur sadipscing elitr, sed diam nonumy eirmod tempor invidunt ut labore et dolore magna aliquyam erat, sed diam voluptua. At vero eos et accusam et justo duo dolores et ea rebum. Stet clita kasd gubergren, no sea takimata sanctus est Lorem ipsum dolor sit amet. Lorem ipsum dolor sit amet, consetetur sadipscing elitr, sed diam nonumy eirmod tempor invidunt ut labore et dolore magna aliquyam erat, sed diam voluptua. At vero eos et accusam et justo duo dolores et ea rebum. Stet clita kasd gubergren, no sea takimata sanctus est Lorem ipsum dolor sit amet. Lorem ipsum dolor sit amet, consetetur sadipscing elitr, sed diam nonumy eirmod tempor invidunt ut labore et dolore magna aliquyam erat, sed diam voluptua. At vero eos et accusam et justo duo dolores et ea rebum. Stet clita kasd gubergren, no sea takimata sanctus est Lorem ipsum dolor sit amet.

Duis autem vel eum iriure dolor in hendrerit in vulputate velit esse molestie consequat, vel illum dolore eu feugiat nulla facilisis at vero eros et accumsan et iusto odio dignissim qui blandit praesent luptatum zzril delenit augue duis dolore te feugait nulla facilisi. Lorem ipsum dolor sit amet, consectetuer adipiscing elit, sed diam nonummy nibh euismod tincidunt ut laoreet dolore magna aliquam erat volutpat.

If you liked this post, please help me share it
  • Reddit
  • StumbleUpon
  • description
  • del.icio.us
  • Digg
  • co.mments
  • Google
  • Slashdot
  • Technorati
  • TwitThis
  • E-mail this story to a friend!
  • Furl

Responses (5)

  1. I am aware that the links and things do not resize on this page because this WordPress theme is inaccessible :(

    However, I encourage you to copy and paste the code into your Firebug console and test it out on an accessible site (replace “multiplier” with a 1) and convince yourself that this method works quite well.

    I encourage any questions about this.

  2. NOTE: In light of the above comment, I have converted eriwen.com to be more fluid so that everything does resize as one would hope. :)

  3. Hi, it’s a nice javascript. Too bad you don’t have example which resize all the page. But thanks anyway! (I need it!) :)

  4. @bima:

    Actually you’re in luck! The method I describe DOES work on all page elements and you can check out a demo at: http://eriwen.com/examples/save-font-size-prefs-example.php

    and see my new post at: http://davidwalsh.name/save-text-size-preference-mootools-12

Trackbacks

Leave a Reply

XHTML: You can use these tags: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <strike> <strong>