I’m designing a website using bootstrap that requires me to use font resize. I tried to do it with some javascript and jquery. The script runs but the font size wasnt responding. How can I make it work and how can i use the !important in these javascript.
$(".decreaseFont").click(function(){
var currentFontSize = $('html').css('font-size');
var currentFontSizeNum = parseFloat(currentFontSize, 10);
var newFontSize = currentFontSizeNum*0.8;
$('html').css('font-size', newFontSize);
return false;
Your code is working.
Fiddle: http://jsfiddle.net/LHzBS/1
Maybe it is the other code in the file has errors. You can use a web console to debug, use:
to add breakpoints.