Skip to content

Commit d619348

Browse files
committed
Fix incorrect position in IE11
- Should close #26
1 parent c16f1d6 commit d619348

File tree

3 files changed

+5
-5
lines changed

3 files changed

+5
-5
lines changed

dist/zoom-vanilla.min.js

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

dist/zoom-vanilla.min.js.map

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

js/zoom-vanilla.js

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -72,8 +72,8 @@
7272
}
7373

7474
function handleScroll(event) {
75-
if (initialScrollPosition === null) initialScrollPosition = window.scrollY
76-
var deltaY = initialScrollPosition - window.scrollY
75+
if (initialScrollPosition === null) initialScrollPosition = window.pageYOffset
76+
var deltaY = initialScrollPosition - window.pageYOffset
7777
if (Math.abs(deltaY) >= 40) closeActiveZoom()
7878
}
7979

@@ -176,7 +176,7 @@
176176
targetImage.offsetWidth // repaint before animating
177177

178178
var imageOffset = offset(targetImage)
179-
var scrollTop = window.scrollY
179+
var scrollTop = window.pageYOffset
180180

181181
var viewportY = scrollTop + (window.innerHeight / 2)
182182
var viewportX = (window.innerWidth / 2)

0 commit comments

Comments
 (0)