I've got a very simple web page spinner using the Prototype JS framework:
Frame nav:
Event.observe(
'doit',
'click',
function(){
parent.window.frames.cont.spinner.removeAttribute('style');
},
false);
Frame cont (this is the first element within the <body>):
<div id="spinner" style="display: none;"></div>
CSS:
#spinner {
width: 50px;
height: 50px;
position: fixed;
top: 50%;
left: 50%;
background: url(spinner.gif) transparent no-repeat center;
margin-left: -25px;
margin-top: -25px;
z-index: 2;
}
Quite simply, it's a fixed-position <div> centered on the cont frame, and hidden when the browser loads the page (also to avoid problems in non-JS browsers). When the user clicks a button in the nav frame, the style attribute is removed and the user sees the spinner until the next page takes over. This works just fine in Firefox, but IE 9 refuses to work. This is what I've found from their standard F12 interface:
- There is only one element with ID
spinner. - Running
parent.window.frames.cont.spinner.removeAttribute('style')orparent.window.frames.cont.document.getElementById("spinner").removeAttribute("style")in the Console tab returnstruebut results in the next but one element being hidden! This is not reflected in the HTML tab in any discernible way - The hidden element still hasstyle="display: block;".
I tried using Prototype's show(), and it worked in Firefox, but not in IE9...
parent.window.frames.cont.spinner.style.display = 'block';worked - Can you make your comment an answer?