I read a bunch of answers to similar queries for dynamic styling, but I still have a few questions.
My end result is that there are 2 buttons on my page, which allows the user to increase or decrease the font size. I saw it around, and it seems that it should not be difficult ...
My C # project uses .less and jquery 1.10.1.
var items = $('[class]').css('font-size');
$(items).each(function(index){
alert('Text:' + $(this).text());
$(this).css('font-size') =($(this).css('font-size').val() * 6) ;
});
I expect the collection of elements to contain DOM elements that have CSS font-size property. I would like to take the current size and apply some multiplier to it. In this case, to make it really obvious, I multiplied the current value by 6. This code is inside the function called by pressing the button. Using a simple warning window in this function, the click works. This code does not work.
Do I need to use '[class]' to create my collection, or is there a way to cut out CSS classes that contain a font?
Is this something that needs to be done on every page, or will the css value be cached somewhere?
Is there an easier way to do this? I do not want to have 3 different stylesheets if this is not needed. Thank you for your help!