Browse Source

use `page{d}Offset` instead of `scroll{d}`

All modern browsers seem to support `window.pageXOffset` and `window.pageYOffset`, which are aliases for `window.scrollX` and `window.scrollY`.

IE doesn't seem to have `window.scrollX` and `window.scrollY`.

fixes #302
pull/303/head
Noah Chase 10 years ago committed by Noah Chase
parent
commit
1f58b1b10b
  1. 2
      Sortable.js
  2. 2
      Sortable.min.js

2
Sortable.js

@ -144,7 +144,7 @@
if (el) {
autoScroll.pid = setInterval(function () {
if (el === win) {
win.scrollTo(win.scrollX + vx * speed, win.scrollY + vy * speed);
win.scrollTo(win.pageXOffset + vx * speed, win.pageYOffset + vy * speed);
} else {
vy && (el.scrollTop += vy * speed);
vx && (el.scrollLeft += vx * speed);

2
Sortable.min.js vendored

File diff suppressed because one or more lines are too long
Loading…
Cancel
Save