> function then the 5th click to reset the font.
jQuery 1.3 lets you specify multiple functions to .toggle(), you could
take advantage of that. I haven't tested this code but maybe something
like this? It looks like your original code was assuming pixels, I've
replicated that although it might be better to split the number from
the units so IE would work for non-pixel units.
function bigger(){
$("p").css({fontSize :
parseFloat($('p').css('font-size'), 10)*1.2
});
}
$("#changeFontSize").toggle(
function(){
this.x_originalSize = $('p').css('font-size');
bigger();
},
bigger, bigger, bigger,
function(){
$("p").css({fontSize : this.x_originalSize});
}
);
No comments:
Post a Comment