We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
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
Current code: https://github.com/twbs/bootstrap/blob/v4-dev/js/src/scrollspy.js
_getScrollTop() { return this._scrollElement === window ? this._scrollElement.scrollY : this._scrollElement.scrollTop }
MDN says the Window.scrollY property is not supported in IE. I was able to confirm this in IE (11.0.9600.18282) on Windows 7. https://developer.mozilla.org/en-US/docs/Web/API/Window/scrollY
One solution is to call jQuery.scrollTop() if scrollY is undefined. This works in IE on Windows 7. https://api.jquery.com/scrollTop/
_getScrollTop() { return this._scrollElement === window ? this._scrollElement.scrollY || $(this._scrollElement).scrollTop() : this._scrollElement.scrollTop }
The text was updated successfully, but these errors were encountered:
Or we could try pageYOffset as mentioned on that MDN article.
pageYOffset
Sorry, something went wrong.
I can take this task on. Can this be assigned to me?
Should I just create a PR?
Hi,
I can confirm that $(this._scrollElement).scrollTop() would work.
This issue was driving me crazy, as it worked on the bootstrap demo page (http://v4-alpha.getbootstrap.com/components/scrollspy/) but not on my project.
In the demo the scrollspy is attached to a div instead to the body, so window.scrollY is not used here, as the _scrollElement != window.
It would be great if one of the posted fixes could be implemented.
KInd regards Andreas
No branches or pull requests
Current code: https://github.com/twbs/bootstrap/blob/v4-dev/js/src/scrollspy.js
MDN says the Window.scrollY property is not supported in IE. I was able to confirm this in IE (11.0.9600.18282) on Windows 7. https://developer.mozilla.org/en-US/docs/Web/API/Window/scrollY
One solution is to call jQuery.scrollTop() if scrollY is undefined. This works in IE on Windows 7. https://api.jquery.com/scrollTop/
The text was updated successfully, but these errors were encountered: