弹出蒙层:
$("#ModalAddNews").modal('show');
document.documentElement.style.overflow = "hidden";//解决滑动弹出层底部跟着滑动的问题
运行以上代码后,滚轮会回到顶部,尚未解决!!!
关闭蒙层:
$("#ModalAddNews").modal('hide');
document.documentElement.style.overflow = "scroll";
以下代码可获得滚轮位置:
var top_value = $(document).scrollTop()||document.documentElement.scrollTop || document.body.scrollTop;