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