I;m trying to implement increase/decrease font size buttons on a site, but nothing is happening. I've set breakpoints and tried changing $('html') to $('body') and although the code runs, no attributes are set. The code I'm using is:
- var startSize = parseFloat($.cookie('fontSize'), 12);
- $('html').css('font-size', startSize);
- // Increase Font Size
- $(".increaseFont").click(function () {
- var currentFontSize = $('html').css('font-size');
- var currentFontSizeNum = parseFloat(currentFontSize, 10);
- var newFontSize = currentFontSizeNum * 1.2;
- $('html').css('font-size', newFontSize);
- $.cookie('fontSize', newFontSize);
- return false;
- });
Even if I remove the cookie, the code runs but nothing happens. Am I missing something obvious?