(function(doc, win) { var docel = doc.documentelement, resizeevt = 'orientationchange' in window ? 'orientationchange' : 'resize', recalc = function() { var clientwidth = docel.clientwidth; if(!clientwidth) return; if(clientwidth >= 750) { docel.style.fontsize = '100px'; } else { docel.style.fontsize = 100 * (clientwidth / 750) + 'px'; } }; if(!doc.addeventlistener) return; win.addeventlistener(resizeevt, recalc, false); doc.addeventlistener('domcontentloaded', recalc, false); })(document, window);