Skip to content

Commit 3003925

Browse files
Merge pull request #136 from iFixit/master
Layout shifts detected during movements
2 parents e648b6f + 88c7a67 commit 3003925

File tree

2 files changed

+7
-6
lines changed

2 files changed

+7
-6
lines changed

dist/easyzoom.js

+2-2
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

src/easyzoom.js

+5-4
Original file line numberDiff line numberDiff line change
@@ -256,10 +256,11 @@
256256
var top = moveY * -1;
257257
var left = moveX * -1;
258258

259-
this.$zoom.css({
260-
top: top,
261-
left: left
262-
});
259+
if ('transform' in document.body.style) {
260+
this.$zoom.css({ transform: 'translate(' + left + 'px, ' + top + 'px)' });
261+
} else {
262+
this.$zoom.css({ top: top, left: left });
263+
}
263264

264265
this.opts.onMove.call(this, top, left);
265266
}

0 commit comments

Comments
 (0)