views:

55

answers:

3

Without getting into the "should a text resizer be used or not" debate, I'd like some help with this...suffice to say that my clientele are from and older generation and may be sight impaired...

My script isn't functioning, and I'm not sure why. It's not live yet, so here's what I'm working with:

   function fsize(size,unit,id){
     var vfontsize = document.getElementById("#colleft");
     if(vfontsize){
      vfontsize.style.fontSize = size + unit;
     }
   }
   var textsize = 14;
   function changetextsize(up){
     if(up){
      textsize = parseFloat(textsize)+2;
     }else{
      textsize = parseFloat(textsize)-2;
     }
   }

I'm using onclick events to trigger the size changes. Thanks for your help!

A: 

1) You are not using "id" parameter in fsize()

2) Please post your onclicks... how are you using fsize and changetextsize together? You don't seen to be using "textsize" value anywhere ... Also, what happens when you click?

DVK
A: 
var vfontsize = document.getElementById("#colleft");

should, most likely, be

var vfontsize = document.getElementById("colleft"); // no hash

it seems to me like remnants from a jquery attempt or similar..

and then, tell us how you are calling these functions you have posted..

Gaby
A: 

Thank you for your quick responses. And sorry, new to a lot of this, stackoverflow included, so your romantic nature is appreciated!

I found a different solution, and it works great.

blackessej
...and thanks for sharing it...
NealB