ロードアニメーションが長い時などにスクロールしてしまうと困るので設定しておくと便利です。
function disable_scroll(event) {
event.preventDefault();
}
if(navigator.userAgent.match(/iPhone|Android.+Mobile/)){
//SP = true
document.addEventListener('touchmove',disable_scroll,{ passive: false });
flag = "SP";
}else{
//PC = true
document.addEventListener('mousewheel', disable_scroll, { passive: false });
flag = "PC";
};
$(window).on('load',function(){
$(window).scrollTop(0);
if(flag == "PC"){
// //PCスクロール禁止解除
document.removeEventListener('mousewheel', disable_scroll, { passive: false });
};
if(flag == "SP"){
// //SPスクロール禁止解除
document.removeEventListener('touchmove', disable_scroll, { passive: false });
}
});