1.打開新頁面時須要禁止鼠標滾輪,禁止頁面滑動;html
1
2
3
4
|
在調用顯示層時加上這句js代碼就能夠了:
document.documentElement.style.overflow = "hidden";
關閉層的時間別忘了在加上這句:
document.documentElement.style.overflow = "scroll";
|
2.設置滾輪原來位置spa
var top_temp = $(document).scrollTop()||document.documentElement.scrollTop || document.body.scrollTop;
window.parent.scrollTo(0,top_value);