GB_001 Posted March 7, 2008 Share Posted March 7, 2008 The javascript for my DHTML window works in FF, but when I try it in IE I get an "Object required' error, please help. function movemouse( e ) { if( isdrag ) { dobj.style.left = nn6 ? tx + e.clientX - x : tx + event.clientX - x; dobj.style.top = nn6 ? ty + e.clientY - y : ty + event.clientY - y; return false; } } function selectmouse( e ) { var fobj = nn6 ? e.target : event.srcElement; var topelement = nn6 ? 'HTML' : 'BODY'; while (fobj.tagName != topelement && fobj.className != 'dragme') { fobj = nn6 ? fobj.parentNode : fobj.parentElement; } if (fobj.className=='dragme') { isdrag = true; dobj = parent.document.getElementById('styled_popup'); tx = parseInt(dobj.style.left+0); ty = parseInt(dobj.style.top+0); x = nn6 ? e.clientX : event.clientX; y = nn6 ? e.clientY : event.clientY; parent.document.onmousemove=movemouse; return false; } } parent.document.onmousedown=selectmouse; parent.document.onmouseup=new Function('isdrag=false'); Thankyou in advanced =). -GB Link to comment https://forums.phpfreaks.com/topic/94960-works-in-ff-but-not-ie/ Share on other sites More sharing options...
GB_001 Posted March 7, 2008 Author Share Posted March 7, 2008 Forgot to add something to the code. var ie = parent.document.all; var nn6 = parent.document.getElementById &&! document.all; var isdrag = false; var x, y; var dobj; function movemouse( e ) { if( isdrag ) { dobj.style.left = nn6 ? tx + e.clientX - x : tx + event.clientX - x; dobj.style.top = nn6 ? ty + e.clientY - y : ty + event.clientY - y; return false; } } function selectmouse( e ) { var fobj = nn6 ? e.target : event.srcElement; var topelement = nn6 ? 'HTML' : 'BODY'; while (fobj.tagName != topelement && fobj.className != 'dragme') { fobj = nn6 ? fobj.parentNode : fobj.parentElement; } if (fobj.className=='dragme') { isdrag = true; dobj = parent.document.getElementById('styled_popup'); tx = parseInt(dobj.style.left+0); ty = parseInt(dobj.style.top+0); x = nn6 ? e.clientX : event.clientX; y = nn6 ? e.clientY : event.clientY; parent.document.onmousemove=movemouse; return false; } } parent.document.onmousedown=selectmouse; parent.document.onmouseup=new Function('isdrag=false'); Link to comment https://forums.phpfreaks.com/topic/94960-works-in-ff-but-not-ie/#findComment-486459 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.