-
Notifications
You must be signed in to change notification settings - Fork 1k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
newer (e.g. 31) Chromes complain about what to scroll #61
Comments
That's a warning that pops in the console? |
ofcourse |
Then it is OK now. |
You should. |
I've seen other similar error from jQuery itself in the console log. Right now they are just warnings. so nothing major to to worry about. |
I mean this console message. |
maybe change it to:
|
That may cause an error. |
Maybe:
|
Let's keep this open, I'm afraid nothing might work once Chrome 33 is released |
Maybe $(window).scrollTop() will do? not sure, need to do some research. |
I ALWAYS use that. Never body, nor html. If it's on part of the document, it's always a div. |
jQuery 1.10.2 // Create scrollLeft and scrollTop methods
jQuery.each( {scrollLeft: "pageXOffset", scrollTop: "pageYOffset"}, function( method, prop ) {
var top = /Y/.test( prop );
jQuery.fn[ method ] = function( val ) {
return jQuery.access( this, function( elem, method, val ) {
var win = getWindow( elem );
if ( val === undefined ) {
return win ? (prop in win) ? win[ prop ] :
win.document.documentElement[ method ] :
elem[ method ];
}
if ( win ) {
win.scrollTo(
!top ? val : jQuery( win ).scrollLeft(),
top ? val : jQuery( win ).scrollTop()
);
} else {
elem[ method ] = val;
}
}, method, val, arguments.length, null );
};
});
function getWindow( elem ) {
return jQuery.isWindow( elem ) ?
elem :
elem.nodeType === 9 ?
elem.defaultView || elem.parentWindow :
false;
} |
I think you can see the warning by using vanilla jQuery. Not sure the core implementation is the solution. |
I see jQuery throwing the same error once and a while, just by itself. |
http://dom.spec.whatwg.org/#concept-document-quirks you could maybe do a test on The "strict mode" chrome is referring to is not change this:
to this maybe:
|
I'll try this fix when I get home Also I'll take from jQuery's code, the one Viktor posted. On Fri, Jan 24, 2014 at 12:54 PM, Troy Morehouse
Ariel Flesler |
Ok, I've been doing some experiments on Windows 7. Chrome 32 shows a warning when on compatibility mode as expected: Chrome 33 beta actually showed no warning and worked with the current version of scrollTo just fine: I tried using the documentElement on all cases and then on compat mode, Chrome 33 didn't work at all. @szepeviktor @nitriques @tmorehouse @Mithgol |
Thanks @flesler |
How did it go @nitriques ? |
Chrome 32 still complains in WinMaxY-compat.html. |
Good, same as me. Thanks. |
You're welcome :) |
Well, closing this. Reopen if something else related comes up |
Please distinguish between old and new webkits.
(and you may use
"use strict";
)The text was updated successfully, but these errors were encountered: