leeq
07-09-2007, 06:37 PM
I'm having a problem in Firefox when trying to make a dynamically generated div jump to the front onclick. These are the two functions in question. The first is fired when the user clicks a link and the second fires when the user clicks on the div created by openWindow().
These work fine in IE, but Firefox doesn't seem to see the dynamically created divs. Please help.
function openWindow(windowAddress, windowName){
newDiv = document.createElement('div')
newDiv.id = windowName
newDiv.style.border= "1px solid black"
newDiv.style.background = "#FFFFFF"
newDiv.appendChild(document.createTextNode('Loading...'))
$('content').appendChild(newDiv)
newDiv.style.position = "absolute"
newDiv.style.top = "60px"
newDiv.style.left = "10px"
new Ajax.Updater(newDiv, windowAddress, {asynchronous:true, evalScripts:true}); return false;
}
function bringToFront(windowId){
openWindows = $(windowId).parentNode.childNodes
for(i=0; i<openWindows.length; i++){
if (openWindows[i] == $(windowId)){
$(windowId).style.zIndex = '99'
}
else{
openWindows[i].style.zIndex = '1'
}
}
}
These work fine in IE, but Firefox doesn't seem to see the dynamically created divs. Please help.
function openWindow(windowAddress, windowName){
newDiv = document.createElement('div')
newDiv.id = windowName
newDiv.style.border= "1px solid black"
newDiv.style.background = "#FFFFFF"
newDiv.appendChild(document.createTextNode('Loading...'))
$('content').appendChild(newDiv)
newDiv.style.position = "absolute"
newDiv.style.top = "60px"
newDiv.style.left = "10px"
new Ajax.Updater(newDiv, windowAddress, {asynchronous:true, evalScripts:true}); return false;
}
function bringToFront(windowId){
openWindows = $(windowId).parentNode.childNodes
for(i=0; i<openWindows.length; i++){
if (openWindows[i] == $(windowId)){
$(windowId).style.zIndex = '99'
}
else{
openWindows[i].style.zIndex = '1'
}
}
}