I'm successfully displaying a photo in Firefox version 22 -- in two different img tags -- one of the img tags has no CSS width or height set, and so the image appears in its original size.
The second img tag is set by a CSS style to be 60px by 60px.
When I set the 'innerHTML' of these two img tags, in Firefox I see the original-size image and the same image shrunk down to fit in the 60px by 60px img tag.
In IE version 10.0.9, I simply do not see anything in the second img tax that is set to be 60px by 60px via CSS.
It's the exact same code that's executing. Is there something I need to do for IE to show the image in the 60px by 60px img tag that is not present in my code here?
By the way, the code below is generated in a PHP file -- I use the 'hidden Iframe' approach to load then display the image on the web page -- the code below is generated in a PHP file then outputs what you see below to my hidden iframe on my html page, which is why you see the code here getting the parent document of the iframe:
<script language="JavaScript" type="text/javascript">
var parDoc = parent.document;
parDoc.getElementById('justOpenedImage').innerHTML =
'<div><img src=\'http://localhost/thesite/aPhoto.jpg\' /></div>';
parDoc.getElementById('60by60').innerHTML =
'<div><img class="60by60Image" src=\'http://localhost/thesite/aPhoto.jpg\' /></div>';
</script>
Here is the CSS class 60by60Image:
.60by60Image
{
border: 2px solid green;
width: 60px;
height: 60px;
display: inline-block;
}
Here is the html on the page:
<!-- THE ORIGINAL-SIZED IMAGE APPEARS FINE HERE IN BOTH IE AND FF -->
<div id="justOpenedImage"></div>
<!-- THE SMALLER IMAGE APPEARS HERE IN FIREFOX BUT NOT IN IE -->
<div>
<img class="60by60Image" id="60by60" src="" />
</div>
This has been working fine in Firefox but in IE it fails to show the smaller 60 by 60 version of the image -- not sure why.