body.scrollTop已弃用?

时间:2014-01-20 10:09:30

标签: jquery

我正在使用jQuery版本1.7.2

我在Google Chrome开发者工具中找到了这些内容:

body.scrollTop is deprecated in strict mode. Please use 'documentElement.scrollTop' if in strict mode and 'body.scrollTop' only if in quirks mode. jquery-1.7.2.min.js:4
body.scrollLeft is deprecated in strict mode. Please use 'documentElement.scrollLeft' if in strict mode and 'body.scrollLeft' only if in quirks mode. jquery-1.7.2.min.js:4
event.returnValue is deprecated. Please use the standard event.preventDefault() instead. jquery-1.7.2.min.js:3

这是错误还是正常?它会影响我的网站吗?

2 个答案:

答案 0 :(得分:0)

您面临的问题是Chrome的常见问题......它使用body.scrollTop来表示标准模式下视口的滚动位置。

我能想到的可能原因是,Chrome的制造商希望开发人员转而使用更正式或更通用的编码方式....对于像Mozilla这样的其他浏览器,我不认为你的问题会存在(你有没有在其他浏览器中查看!!在我的mozilla上看起来很好。

<强> Try this Fix

答案 1 :(得分:0)

不,这不是问题。这只是一个建议。尽管使用最新版本的jQuery是最佳实践。因此,在我看来,您应该更新到最新版本。