MyBB Community Forums

Full Version: Font Resize script
You're currently viewing a stripped down version of our content. View the full version with proper formatting.
Hi,
I found code for font resize to website..How can we apply to MYBB?
http://www.white-hat-web-design.co.uk/ar...ntsize.php
var min=8;
var max=18;
function increaseFontSize() {
   var p = document.getElementsByTagName('p');
   for(i=0;i<p.length;i++) {
      if(p[i].style.fontSize) {
         var s = parseInt(p[i].style.fontSize.replace("px",""));
      } else {
         var s = 12;
      }
      if(s!=max) {
         s += 1;
      }
      p[i].style.fontSize = s+"px"
   }
}
function decreaseFontSize() {
   var p = document.getElementsByTagName('p');
   for(i=0;i<p.length;i++) {
      if(p[i].style.fontSize) {
         var s = parseInt(p[i].style.fontSize.replace("px",""));
      } else {
         var s = 12;
      }
      if(s!=min) {
         s -= 1;
      }
      p[i].style.fontSize = s+"px"
   }   
}

and put this to the index
<a href="javascript:decreaseFontSize();">-</a>
<a href="javascript:increaseFontSize();">+</a>
In your CSS for your theme wouldn't it? It can be done much easier Wink
(also wrong section...)
Can you show some example?I think it good the function resize AA..coz sometime we have eyes problem when reading
Try holding CTRL down an then press '+' on you keyboard. Wink

... a little bit OT - I know...
(2009-08-21, 08:34 AM)querschlaeger Wrote: [ -> ]Try holding CTRL down an then press '+' on you keyboard. Wink

... a little bit OT - I know...

for us i think no problem to remember this but for certain people..they cant remember CTRL+
You can always just go View>Zoom>Zoom Text Only. That's for firefox anyway.