DIV弹窗后禁止页面滚动,IE和FF通用,基于prototype

DIV弹出之前,禁止页面滚动:
if(Prototype.Browser.IE){
$($$(‘html’)[0]).setStyle({overflow : ‘hidden’});
}else{
$($$(‘body’)[0]).setStyle({overflow : ‘hidden’});
}

DIV关闭之后,恢复页面滚动:
if(Prototype.Browser.IE){
$($$(‘html’)[0]).setStyle({overflow : ‘auto’});
}else{
$($$(‘body’)[0]).setStyle({overflow : ‘auto’});
}

Leave a Comment

Your email address will not be published.

*