1,去掉<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0
Transitional//EN"
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">这样的web标准语句,因为加上后会让document.body.scrollTop一直为0
2解决办法:写:document.documentElement.scrollTop
![](/Images/OutliningIndicators/None.gif)
![](/Images/OutliningIndicators/None.gif)
![](/Images/OutliningIndicators/None.gif)
2解决办法:写:document.documentElement.scrollTop