The following code works fine in IE but not in Firefox:
ContainerDiv is well.. a div.
ContainerFrame is well.. an iFrame.
The following gets the objects to show but does not position correctly.
I tried some ..iffy.. tests (alert(document.getElementById('objectName')); (where objectName was either containerDiv or containerFrame and both returned that its an html element so it is being recognized.
I can't access the event model in firefox, nor use code that other sites say should work. They don't work.
ALFII.com
---------------------
If this post answered or helped to answer your question, please reply with such so that forum members with a similar question will know to use this advice.
Code:
document.getElementById('containerFrame').style.left = document.body.scrollLeft + (event.clientX - 5) + 'px';
document.getElementById('containerFrame').style.top = document.body.scrollTop + (event.clientY - 5) + 'px';
document.getElementById('containerDiv').style.left = document.body.scrollLeft + (event.clientX - 5) + 'px';
document.getElementById('containerDiv').style.top = document.body.scrollTop + (event.clientY - 5) + 'px';
document.getElementById('containerFrame').style.width = document.getElementById('containerDiv').offsetWidth + 'px';
document.getElementById('containerFrame').style.height = document.getElementById('containerDiv').offsetHeight + 'px';
document.getElementById('containerDiv').style.display = '';
document.getElementById('containerFrame').style.display = '';
ContainerDiv is well.. a div.
ContainerFrame is well.. an iFrame.
The following gets the objects to show but does not position correctly.
Code:
// document.getElementById('containerFrame').style.left = document.body.scrollLeft + (event.clientX - 5) + 'px';
// document.getElementById('containerFrame').style.top = document.body.scrollTop + (event.clientY - 5) + 'px';
document.getElementById('containerDiv').style.left = 50;
document.getElementById('containerDiv').style.top = 50;
document.getElementById('containerFrame').style.width = document.getElementById('containerDiv').offsetWidth + 'px';
document.getElementById('containerFrame').style.height = document.getElementById('containerDiv').offsetHeight + 'px';
document.getElementById('containerDiv').style.display = '';
document.getElementById('containerFrame').style.display = '';
I tried some ..iffy.. tests (alert(document.getElementById('objectName')); (where objectName was either containerDiv or containerFrame and both returned that its an html element so it is being recognized.
I can't access the event model in firefox, nor use code that other sites say should work. They don't work.
ALFII.com
---------------------
If this post answered or helped to answer your question, please reply with such so that forum members with a similar question will know to use this advice.