Comments (25)
That's a warning that pops in the console?
from jquery.scrollto.
ofcourse
from jquery.scrollto.
See https://twitter.com/derickbailey/status/425299085537460224
from jquery.scrollto.
Then it is OK now.
I do not care about the console.
from jquery.scrollto.
I do not care about the console.
You should.
from jquery.scrollto.
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.
from jquery.scrollto.
I mean this console message.
Or should this webkit condition be deleted?
https://github.com/flesler/jquery.scrollTo/blob/master/jquery.scrollTo.js#L48
from jquery.scrollto.
maybe change it to:
return (document.body.scrollTop) ? document.body : document.documentElement;
from jquery.scrollto.
That may cause an error.
return (document.documentElement.scrollTop) ? document.documentElement : document.body;
from jquery.scrollto.
Maybe:
return (document.documentElement && document.documentElement.scrollTop) ?
document.documentElement : document.body;
from jquery.scrollto.
Let's keep this open, I'm afraid nothing might work once Chrome 33 is released
from jquery.scrollto.
Maybe $(window).scrollTop() will do? not sure, need to do some research.
I appreciate if you guys help out.
from jquery.scrollto.
Maybe $(window).scrollTop()
I ALWAYS use that. Never body, nor html. If it's on part of the document, it's always a div.
from jquery.scrollto.
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;
}
from jquery.scrollto.
I think you can see the warning by using vanilla jQuery. Not sure the core implementation is the solution.
from jquery.scrollto.
I see jQuery throwing the same error once and a while, just by itself.
from jquery.scrollto.
http://dom.spec.whatwg.org/#concept-document-quirks
you could maybe do a test on document.compatMode
. If it exists and has a value of CSS1Compat
then scroll the documentElement
, otherwise revert to scrolling the body
element.
The "strict mode" chrome is referring to is not use strict
, but rather the rendering mode of the browser (based on the DOCTYPE
)
change this:
return /webkit/i.test(navigator.userAgent) || doc.compatMode == 'BackCompat' ?
doc.body :
doc.documentElement;
to this maybe:
return doc.compatMode && doc.compatMode == 'CSS1Compat' ?
doc.documentElement :
doc.body;
from jquery.scrollto.
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
[email protected]:
http://dom.spec.whatwg.org/#concept-document-quirks
you could maybe do a test on document.compatMode. If it exists and has a
value of CSS1Compat then scroll the documentElement, otherwise revert to
scrolling the body element.The "strict mode" chrome is referring to is not use strict, but rather
the rendering mode of the browser (based on the DOCTYPE)—
Reply to this email directly or view it on GitHubhttps://github.com//issues/61#issuecomment-33234233
.
Ariel Flesler
from jquery.scrollto.
Ok, I've been doing some experiments on Windows 7.
Updated the tests to use the latest version of jquery, you can try them yourself.
The results were unexpected.
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.
So the lesson is, Chrome 33 beta only works with the body which is the way it is right now.
@szepeviktor @nitriques @tmorehouse @Mithgol
I encourage you to try it yourself on other platforms and browsers let me know what you get.
from jquery.scrollto.
Thanks @flesler
I will test tomorrow!
from jquery.scrollto.
How did it go @nitriques ?
Can you guys take a look too? @szepeviktor @tmorehouse @Mithgol
from jquery.scrollto.
Chrome 32 still complains in WinMaxY-compat.html.
But Chrome 34 (canary) does not.
from jquery.scrollto.
Good, same as me. Thanks.
from jquery.scrollto.
You're welcome :)
from jquery.scrollto.
Well, closing this. Reopen if something else related comes up
from jquery.scrollto.
Related Issues (20)
- Tween HOT 4
- can this plugin be used to scroll to the bottom of the div HOT 2
- On chrome, if "scroll-behavior: smooth", the duration acts like a delay instead of duration HOT 1
- Not working in Firefox HOT 3
- How to fire jquery.scrollTo after page is completely loaded with all stuff HOT 1
- Cant get my website to work cross browser HOT 2
- initializing plugin using webpack HOT 1
- Not working in mobile version HOT 1
- Would be nice to support centering like scrollIntoView() HOT 2
- Setting to align scrolled item (e.g to bottom) HOT 3
- jQuery.isFunction() is deprecated HOT 1
- Please add info to not to use slim version of JQuery
- Small proposition to cdn doc HOT 1
- Configure speed and ease in HOT 1
- trick like scrollIntoView (center of div) HOT 1
- Scroll to second ID with the same name HOT 1
- Does it work with SVG? HOT 1
- How to scroll lists (ul or ol)? HOT 1
- [email protected]
- Scroll only if element is offscreen? HOT 2
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from jquery.scrollto.