ドラッグした要素を取得するためにdocument.elementFromPointを使用しています。しかし、それはnullを返します。私は同じデバッグし、同じコードを実行すると、オブジェクトが返されます。続きdocument.elementFromPointがIEでnullを返す
はコードです:
function GetZoneFromPoint(x, y, prtDrag, elemIBeam,evnt) {
if (x == null || y == null || prtDrag == null || elemIBeam == null)
alert("Null in GetZone");
var prtDragZIndexOld = prtDrag.style.zIndex;
var elemIBeamZIndexOld = elemIBeam.style.zIndex;
prtDrag.style.zIndex = -1;
elemIBeam.style.zIndex = -1;
var zone;
zone = document.elementFromPoint(x, y);
prtDrag.style.zIndex = prtDragZIndexOld;
elemIBeam.style.zIndex = elemIBeamZIndexOld;
if (zone == null) {
zone = document.elementFromPoint(x, y);
if (zone == null) {
debugger;
zone = event.rangeParent;
}
}
if (zone == null) {
alert('null');
return null;
}
if (x < 0 || x > document.body.clientWidth ||
y < 0 || y > document.body.clientHeight) {
zone = null;
}
else if ((zone.className == 'LayoutWellElement') ||
(zone.className == 'LayoutMainElement') ||
(zone.className == 'ElementFrame')) {
while ((!FIsZone(zone)) && (zone.tagName != 'BODY')) {
zone = zone.parentElement;
}
}
if (!FIsZone(zone)) {
zone = null;
}
return zone;
}