Skip to content

Commit 2b1ec43

Browse files
committed
Break long lines
- Should've done it for the JS in c16f1d6
1 parent c53568e commit 2b1ec43

File tree

4 files changed

+14
-5
lines changed

4 files changed

+14
-5
lines changed

README.md

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -43,7 +43,8 @@ an issue! Thanks!
4343

4444
## Known issues
4545

46-
- The image is appended to the body; use an appropriate CSS selector for extra styling
46+
- The image is appended to the body; use an appropriate CSS selector for extra
47+
styling
4748
- Zooming may not be quite right if the aspect ratio of the image is changed
4849

4950
## Build

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: 10 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,9 +4,17 @@
44
// From http://youmightnotneedjquery.com/#offset
55
function offset(element) {
66
var rect = element.getBoundingClientRect()
7+
var scrollTop = window.pageYOffset ||
8+
document.documentElement.scrollTop ||
9+
document.body.scrollTop ||
10+
0
11+
var scrollLeft = window.pageXOffset ||
12+
document.documentElement.scrollLeft ||
13+
document.body.scrollLeft ||
14+
0
715
return {
8-
top: rect.top + window.pageYOffset || document.documentElement.scrollTop || document.body.scrollTop || 0,
9-
left: rect.left + window.pageXOffset || document.documentElement.scrollLeft || document.body.scrollLeft || 0
16+
top: rect.top + scrollTop,
17+
left: rect.left + scrollLeft
1018
}
1119
}
1220

0 commit comments

Comments
 (0)