Search code examples
javascriptsafariscrollosx-lionfixed

document.body.scrollLeft does not trigger as expected in Safari on OSX Lion


Safari does not update the document.body.scrollLeft when sliding a finger on Apples magic mouse or on the touchpad. It only triggers when releasing the finger. Try following example in Safari under OSX Lion. It updates as expected in other browsers but works like the swiping on iOS in Safari Lion (seems to triggers on "touchend").

Dragging the scrollbar makes it behave as expected. Scrolling forth and back with the touchpad or Apples magic mouse makes it behave weird.

Demo

Fiddle

It can be solvable by moving the content into a container with width: 100%; height: 100%; overflow-left: scroll; but my problem is that need to get it from the body. Any ideas?


Solution

  • It seems like Apple has fixed this now, since it now suddenly works for me without changing anything.