body.scrollTop已弃用? [英] body.scrollTop is deprecated?
问题描述
我正在使用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
这是错误还是正常?它会影响我的网站吗?
您面临的问题是chrome的一般问题.....它使用body.scrollTop
表示标准模式下视口的滚动位置. /p>
我能想到的可能原因是chrome的制造商希望开发人员改用更正式或通用的编码风格....对于其他浏览器(例如Mozilla),我认为您的问题不会在那里(您也检查过其他浏览器吗!!?在我的mozilla上看起来还不错.
I am using jQuery
version 1.7.2
I found these lines in Google Chrome Developer Tools:
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
Is that an error or is it normal? Does it affect my website?
The problem you are facing is general one for chrome.....it uses body.scrollTop
to represent the view-port's scroll position in standards mode.
Possible reason i can think of is that the makers of chrome want the developers to switch to more formal or universal style of coding....as for other browsers like Mozilla, I don't think your problem would be there (have you checked in other browsers too !!? looks fine on my mozilla.
这篇关于body.scrollTop已弃用?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!