viewportdesign / dynamicFontSize.js

JQuery Script to resize DOM Elements with font-sizes in px. This will dynamically resize on window resizing, similar to vw,vh, but pure JS solution. Feel free to Use, Share and Modify.

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

dynamicFontSize.js

This JQuery Script enables you to simulate the vw, vh Behaviour to Font-Size defined in px, that way it will use pure Javascript and therefore you'll be able to use it in older versions of IE or some devices which don't support CSS3 completely yet. Just set a baseWidth Parameter in the Script (to the page width you like your font sizes in px). Then in document.ready Function call DynamicFontSize.init(), this will automatically set Event Handlers for resizing. You'll also need to include Jquery. You can also set a min-font-size and max-font-size in the scripts first lines. I hope you like it.

About

JQuery Script to resize DOM Elements with font-sizes in px. This will dynamically resize on window resizing, similar to vw,vh, but pure JS solution. Feel free to Use, Share and Modify.


Languages

Language:JavaScript 100.0%