Open Marszed opened 7 years ago
winTcanvasXY: function (canvas, x, y) { var cC = canvas.getBoundingClientRect();
// author Marszed https://github.com/Marszed // 解决页面滚动,刮刮乐失效的问题 // FIX chrome对document.documentElement.scrollHeight&document.documentElement.scrollTop是不能识别的,而firefox和IE11不能识别document.body.scrollHeight&document.body.scrollTop // 需要减去滚动距离 var scrollTop = document.body.scrollTop==0?document.documentElement.scrollTop:document.body.scrollTop; return { x: x - cC.left, y: y - cC.top - scrollTop } }
winTcanvasXY: function (canvas, x, y) { var cC = canvas.getBoundingClientRect();