Web Accessibility query... Right, i'm trying to implement the simplest code which can allow web users to choose text size...like on sites where you have: A A A ...sort of thing. Now - this can be done via CSS, but it would be a bit of a fanny on and means having to maintain several style sheets. I've noticed that using Ctrl+Mousewheel enlarges/shrinks everything, and in proportion. However, using View > Text Size has absolutely no effect (does anyone know why?) So basically, I was wondering if there is maybe a JavaScript equivalent to the Ctrl+Mousewheel? Cheers!
try this , Im sure you can work what the code does... var min=8; var max=18; function increaseFontSize() { var p = document.getElementsByTagName('p'); for(i=0;i<p.length;i++) { if(p.style.fontSize) { var s = parseInt(p.style.fontSize.replace("px","")); } else { var s = 12; } if(s!=max) { s += 1; } p.style.fontSize = s+"px" } } function decreaseFontSize() { var p = document.getElementsByTagName('p'); for(i=0;i<p.length;i++) { if(p.style.fontSize) { var s = parseInt(p.style.fontSize.replace("px","")); } else { var s = 12; } if(s!=min) { s -= 1; } p.style.fontSize = s+"px" } }