Created
December 4, 2011 03:26
-
-
Save brandonrunyon/1429042 to your computer and use it in GitHub Desktop.
accessibility feature: enlarge text
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
function resize(ele, size, classname){ | |
var elem = document.getElementsByTagName(ele); | |
for (var i=0; i<elem.length; i++) | |
{ | |
if (elem[i].className==classname) { | |
elem[i].style.fontSize=size; | |
} | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
My boss became fixated on the "A A+ A++" font enlargement feature on some sites, so I made him one so he would leave me alone.
Resizes the font of elements of a given class.
Usage:
Ancor tag -> onclick="resize('p', '14pt', 'content');"
(I know thats not as semantic or clean, but I don't feel like doing click binding right now...)