diff --git a/src/dom.js b/src/dom.js index bb921d6..fbe8e23 100644 --- a/src/dom.js +++ b/src/dom.js @@ -225,6 +225,7 @@ $.measureTextWidth = function (text) { div.style.height = 'auto'; div.style.width = 'auto'; div.style.whiteSpace = 'nowrap'; + div.style.top = '-9999px'; div.innerText = text; document.body.appendChild(div); return div.clientWidth + 1; diff --git a/src/style.js b/src/style.js index c32efe0..3f543ce 100644 --- a/src/style.js +++ b/src/style.js @@ -33,10 +33,7 @@ export default class Style { bindResizeWindow() { this.onWindowResize = this.onWindowResize.bind(this); this.onWindowResize = throttle(this.onWindowResize, 300); - - if (this.options.layout === 'fluid') { - $.on(window, 'resize', this.onWindowResize); - } + $.on(window, 'resize', this.onWindowResize); } bindScrollHeader() {