Skip to content

Instantly share code, notes, and snippets.

@brandonrunyon
Created December 4, 2011 03:26
Show Gist options
  • Save brandonrunyon/1429042 to your computer and use it in GitHub Desktop.
Save brandonrunyon/1429042 to your computer and use it in GitHub Desktop.
accessibility feature: enlarge text
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;
}
}
}
@brandonrunyon
Copy link
Author

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...)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment