基本原理:使用當(dāng)彈窗出現(xiàn)的時(shí)候?qū)㈨撁鎎ody的position設(shè)置為fixed并記錄此刻滾動(dòng)的位置,彈窗消失去除position屬性
1.打開彈框前
startFixedScroll(scrollY)?{??????document.body.style.cssText?+=?'position:fixed;width:100%;top:-'?+?scrollY?+?'px;';????},

2.關(guān)閉彈框后
let?body?=?document.body;??????body.style.position?=?'';??????let?top?=?body.style.top;??????document.body.scrollTop?=?document.documentElement.scrollTop?=?-parseInt(top);??????body.style.top?=?'';
