Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- function getPPI()
- {
- var div = document.createElement('div');
- div.style.width = '1in';
- var body = document.getElementsByTagName('body')[0];
- body.appendChild(div);
- var ppi = document.defaultView.getComputedStyle(div, null).getPropertyValue('width');
- body.removeChild(div);
- return parseFloat(ppi);
- }
- $(document).ready(function()
- {
- var r = 8/360; // valeur à changer en fonction du font-size de base du body
- var w = $(document).width();
- var p = getPPI();
- $('body').css({'font-size':(w*r*p/96)+'px'});
- });
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement