瀏覽代碼

Fix mouse position for iOS (fixes #668).

pull/675/merge
Matthew Petroff 6 年之前
父節點
當前提交
d12baa08d4
共有 1 個文件被更改,包括 3 次插入2 次删除
  1. +3
    -2
      src/js/pannellum.js

+ 3
- 2
src/js/pannellum.js 查看文件

@@ -658,8 +658,9 @@ function aboutMessage(event) {
function mousePosition(event) {
var bounds = container.getBoundingClientRect();
var pos = {};
pos.x = event.clientX - bounds.left;
pos.y = event.clientY - bounds.top;
// pageX / pageY needed for iOS
pos.x = (event.clientX || event.pageX) - bounds.left;
pos.y = (event.clientY || event.pageY) - bounds.top;
return pos;
}



Loading…
取消
儲存