Just set a scroll event and put the scrollTop back to 0 or the last known position, then unbind the scroll event when done.
function modals(){
$('.modal').hide();
$('.modal').on('show shown',function(){
var top = $("body").scrollTop();
(function(pos) {
$(window).scroll(function(e) {
$("body").scrollTop( 0 );
//OR
$("body").scrollTop( pos );
});
})(top);
});
$('.modal').on('hide hidden',function(){
$(window).unbind("scroll");
});
}