Alex Rivera | Logout

How to increment font size changes with jQuery?

Asked 2011-05-12T08:36:06.213
18

Hi I want to change the font size of the page incrementally with jQuery how do I do that?

Something like:

$('body').css({'font-size':'+.01px'});
$('body').css({'font-size':'-.01px'});
Edit
Report

1 Answer

37

You could do so :

var fontSize = parseInt($("body").css("font-size"));
fontSize = fontSize + 1 + "px";
$("body").css({'font-size':fontSize});


jsFiddle example here

answered 2011-05-12T08:45:19.467

Your Answer