Created
October 23, 2014 12:13
-
-
Save kalinchernev/86a18a1c98cff5e03246 to your computer and use it in GitHub Desktop.
Resizor of font-size in a given div container
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
var zoomText = function (change) { | |
var fontSize, fonts, container; | |
container = $("#block-system-main"); | |
fontSize = Math.floor(parseFloat(container.css('font-size')) / 16); | |
fonts = ["1em", "1.2em", "1.4em"]; | |
if (change === -1 & fontSize > 0) { | |
fontSize--; | |
} | |
if (change === 1 & fontSize < 4) { | |
fontSize++; | |
} | |
container.css("font-size", fonts[fontSize]); | |
}; |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment