Search this blog

Home Download Tips Our Stores About

Adbrite

Your Ad Here

Hot Offers


Masukkan Code ini K1-2BE745-X
untuk berbelanja di KutuKutuBuku.com

Visit Our Sponsor

Tuesday, July 6, 2010

How to change font size using Javascript  

var min=11;
var max=16;
function increaseFontSize() {
var p = document.getElementById('storyDiv');

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.getElementById('storyDiv');

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";

}


What next?

You can also bookmark this post using your favorite bookmarking service:

Related Posts by Categories



2 comments: to “ How to change font size using Javascript

Post a Comment

Best Seller