<script> var throttleWaiting = false; function throttle (callback, limit) { return function () { if (!throttleWaiting) { callback.apply(this, arguments); throttleWaiting = true; setTimeout(function () { throttleWaiting = false; }, limit); } } } function fireResize() { throttle(function(){ window.dispatchEvent(new Event('resize')); }, 250)(); } document.addEventListener('scroll', fireResize, {passive: true}); </script>