使用某些 DOCTYPE 时会导致 document.body.scrollTop 失效,总是等于 0, 这使得在编写一些浮动层的定位代码时会出现差错。解决的办法是改用 document.documentElement.scrollTop.
(document.documentElement 在通常情况下就是 <HTML> 标签)

详细的参考在这里:

http://blog.sina.com.cn/u/558da3f3010000qa
http://www.evolt.org/article/document_body_doctype_switching_and_more/17/30655/

相关文章:

  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
  • 2021-08-18
  • 2022-12-23
  • 2022-01-22
  • 2022-12-23
猜你喜欢
  • 2022-12-23
  • 2021-08-20
  • 2022-12-23
  • 2021-07-18
  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
相关资源
相似解决方案