A few months back, I developed a web application and confirmed its functionality in Internet Explorer, Firefox, and Chrome.
Yesterday, while trying to make an addition, I realized that my hide iframe feature stopped working in Chrome.
Upon inspecting the element, I noticed that the attribute was being modified as intended, but the iframe remained visible.
function hideIFrame(){
document.getElementById("myFrame").style.visibility="hidden";
self.focus();
}
function showIFrame(){
document.getElementById("myFrame").style.visibility="visible";
}
The myFrame div is initially hidden. It becomes visible successfully, but when attempting to hide it, Chrome fails to do so - unlike Firefox and IE which still hide it properly.
Any thoughts on why this might be happening?
Solution:
function hideIFrame(){
document.getElementById("myFrame").style.visibility="hidden";
document.getElementById("myFrame").style.opacity=0;
self.focus();
}
function showIFrame(){
document.getElementById("myFrame").style.visibility="visible";
document.getElementById("myFrame").style.opacity=1;
}