Posted By

MistaTwista on 10/10/13


Tagged

resize jquery font


Versions (?)

jQuery fontResize


 / Published in: jQuery
 

  1. function fontResize() {
  2. //Set default resolution and font size
  3. var resolution = 1024;
  4. var font = 13;
  5.  
  6. //Get window width
  7. var width = $(window).width();
  8.  
  9. //Set new font size
  10. var newFont = font * (width/resolution);
  11. $('body').css('font-size', newFont);
  12. };
  13.  
  14. $(document).ready(function()
  15. {
  16. fontResize();
  17. $(window).bind('resize', function() {
  18. fontResize();
  19. });
  20. }
  21. );

Report this snippet  

You need to login to post a comment.