I\'m using the scrollTo jQuery plugin and would like to know if it is somehow possible to temporarily disable scrolling on the window element through Javascript? The reason
var winX = null, winY = null; window.addEventListener('scroll', function () { if (winX !== null && winY !== null) { window.scrollTo(winX, winY); } }); function disableWindowScroll() { winX = window.scrollX; winY = window.scrollY; }; function enableWindowScroll() { winX = null; winY = null; };