Whoa - this is for school? Well in that case, we don't do homework. Using PHP to write out your image's dimensions will only slow the page down though. I thought this grade F was for the speed test, not for school. If it's just for the speed test, then it's nothing to worry about. The page is fast, layout space is allocated by the css on the .slide class so the browser doesn't have to spend any appreciable time wondering about the image size. You could speed that up a little. Since all of the images are 350x263, you could specify that in the css:
Code:
#fadeshow2 .gallerylayer img {
width: 350px;
height: 263px;
}
You may still fail the speed test, but the images now have dimensions and the browser will be spending 0 time wondering about them.
But you would save way more time by optimizing those images.
In an unrelated matter, this:
Code:
<script type="text/javascript">
// Add a script element as a child of the body
function downloadJSAtOnload() {
var element = document.createElement("images/nav/cbjscbinsmenu.js");
element.src = "images/nav/cbjscbinsmenu.js";
document.body.appendChild(element);
}
// Check for browser support of event handling capability
if (window.addEventListener)
window.addEventListener("load", downloadJSAtOnload, false);
else if (window.attachEvent)
window.attachEvent("onload", downloadJSAtOnload);
else window.onload = downloadJSAtOnload;
</script>
isn't doing anything other than throwing an error. That highlighted line should be:
Code:
var element = document.createElement("script");
But even then, the menu probably won't work. You would be better off just using an ordinary external script tag and then running the InitEasyMenu function onload or better yet as the last thing before the </body> tag.
Like replacing the entire code block with:
Code:
<script type="text/javascript" src="images/nav/cbjscbinsmenu.js"></script>
<script type="text/javascript">
if (window.addEventListener)
window.addEventListener("load", InitEasyMenu, false);
else if (window.attachEvent)
window.attachEvent("onload", InitEasyMenu);
else window.onload = InitEasyMenu;
</script>
or skip that second script and add just before </body>:
Code:
<script type="text/javascript">
InitEasyMenu();
</script>
Bookmarks