0

CSS

html, body {
  width: 100%;
  overflow-x: hidden
}

Setting above CSS in a page removes scroll from window [but triggers it on body], hence

 pageOffset =  (window.pageYOffset && { X: window.pageXOffset, Y: window.pageYOffset }) || {},
 dElementOffset = (dE && { X: dE.scrollLeft, Y: dE.scrollTop }) || {},
 dBodyOffset = (dB && { X: dB.scrollLeft, Y: dB.scrollTop }) || {};

[db = document.body, dE = document.documentElement]

None of the above code gives the number of pixels scrolled. Is there a way to determine scroll values in such cases? http://jsbin.com/zayem/1/edit?html,css,js,console,output [Need to load it in a separate html file; Linked it just for understanding]

2
  • By removes scroll from window, do you mean the scroll event or the scrollbar? Because while the horizontal scrollbar is removed the window scroll event still fires as there is still a vertical scrollbar jsfiddle.net/5JtHp Commented Feb 13, 2014 at 16:18
  • My Problem is almost the same as stackoverflow.com/questions/4809106/… Commented Feb 13, 2014 at 19:56

1 Answer 1

0

document.documentElement.scrollLeft works for me. I tested it.

Also, your resizing columns are lagging.

Sign up to request clarification or add additional context in comments.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.