Javascript text Resize
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!
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?
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..
精彩评论