0
글꼴 크기를 늘리거나 줄이기위한 다음 스크립트를 찾았지만 누구나 기본 글꼴 기능을 수행하는 방법을 알고 있습니까?기본 텍스트 크기 기능을 추가하는 방법 - Javascript
var min=8;
var max=18;
function increaseFontSize() {
var p = document.getElementsByTagName('div');
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('div');
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"
}
}
이 질문에 대한 답변을 제공해 주시겠습니까? – Aziz
세 개의 버튼, 증가, 감소 및 기본 글꼴 크기가 있습니다. – Caremy
A+ – Caremy