Don't use getComputedStyle() if it is not available (fake styles).
This commit is contained in:
parent
4817368010
commit
edc2618568
|
@ -314,7 +314,7 @@
|
||||||
if (menu.offsetWidth) menu.style.width = (menu.offsetWidth+2) + "px";
|
if (menu.offsetWidth) menu.style.width = (menu.offsetWidth+2) + "px";
|
||||||
var x = event.pageX, y = event.pageY;
|
var x = event.pageX, y = event.pageY;
|
||||||
var bbox = document.body.getBoundingClientRect();
|
var bbox = document.body.getBoundingClientRect();
|
||||||
var styles = window.getComputedStyle(document.body);
|
var styles = (window.getComputedStyle ? window.getComputedStyle(document.body) : {marginLeft: "0px"});
|
||||||
var bodyRight = bbox.right - Math.min(0,bbox.left) + parseFloat(styles.marginLeft);
|
var bodyRight = bbox.right - Math.min(0,bbox.left) + parseFloat(styles.marginLeft);
|
||||||
if (!x && !y && "clientX" in event) {
|
if (!x && !y && "clientX" in event) {
|
||||||
x = event.clientX + document.body.scrollLeft + document.documentElement.scrollLeft;
|
x = event.clientX + document.body.scrollLeft + document.documentElement.scrollLeft;
|
||||||
|
|
Loading…
Reference in New Issue
Block a user