Skip to content
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

Window scrollTop resets scrollLeft and vice versa #135

Open
kaittodesk opened this issue Oct 2, 2014 · 1 comment
Open

Window scrollTop resets scrollLeft and vice versa #135

kaittodesk opened this issue Oct 2, 2014 · 1 comment

Comments

@kaittodesk
Copy link

Don't know if it is a feature or a bug, but when scrollTop or scrollLeft is called on already scrolled window, it will reset value that was not changed.

For example:

window.scrollTo(10, 10)
$(window).scrollLeft(20)

The second line will change the scroll position from 10, 10 to 20, 0. I think it should change scroll position to 20, 10 as it makes more sense, because the function name references to only one coordinate.

What do you think? Should it be changed or is it working as intended?

@JlineZen
Copy link

What you have said is easily to understand. The function window.scroll(10,10) means that the position of the document on the window moves to 10,10. while the function $(window).scrollLeft(20) is change the position on that condition before!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants