<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>
Preview:
downloadDownload PNG
downloadDownload JPEG
downloadDownload SVG
Tip: You can change the style, width & colours of the snippet with the inspect tool before clicking Download!
Click to optimize width for Twitter