Using jQuery, I would like to disable scrolling of the body:
My idea is to:
body{ overflow: hidden;}
Somebody posted this code, which has the problem of not retaining the scroll position when restored. The reason is that people tend to apply it to html and body or just the body but it should be applied to html only. This way when restored the scroll position will be kept:
$('html').css({
'overflow': 'hidden',
'height': '100%'
});
To restore:
$('html').css({
'overflow': 'auto',
'height': 'auto'
});