Forum Moderators: open
What I'm trying to do is have these images cached so things will work faster and for the life of me I cannot work out if i've done it or not. I got an idea I though i would copy the menu part to a floppy and try it from there but it does not seem as if they are cached, can you do it this way?
first here is my Menu script:
var press
function TheImage(image)
{
if (press==1)
document.vbadvanced.src="menuframe/VBAdvanced1.gif";
if (press==2)
document.vbmidway.src="menuframe/VBMidway1.gif";
if (press==3)
document.vbbasics.src="menuframe/VBBasics1.gif";
if (press==4)
document.maths.src="menuframe/MATHS1.gif";
if (press==5)
document.btec.src="menuframe/BTEC1.gif";
if (image==1)
{
document.vbadvanced.src="menuframe/VBAdvanced.gif";
press=1
document.getElementById('chd').innerText = "This gives you examples in Visual Basic Advanced.."
}
if (image==2)
{
document.vbmidway.src="menuframe/VBMidway.gif";
press=2
document.getElementById('chd').innerText = "This gives you examples in Visual Basic Intermediate.."
}
if (image==3)
{
document.vbbasics.src="menuframe/VBBasics.gif";
press=3
document.getElementById('chd').innerText = "This gives you examples on Visual Basic the basics.."
parent.mainleftframe.document.location = "menuframe/vbbasics/middleleftframe.html"
}
if (image==4)
{
document.maths.src="menuframe/MATHS.gif";
press=4
document.getElementById('chd').innerText = "This will give you different routines to use in your programs"
}
if (image==5)
{
document.btec.src="menuframe/BTEC.gif";
press=5
document.getElementById('chd').innerText = "This give you information and examples for the budding BTECer"
}
}
now my HTML part..
<HTML>
<HEAD>
<TITLE>HomePage</TITLE>
<SCRIPT language=JavaScript src="js/menu.js"></SCRIPT>
<script language="JavaScript">
function doPreload()
{
var the_images = new Array('menuframe/BTEC.gif','menuframe/BTEC1.gif');
preloadImages(the_images);
}
function preloadImages(the_images_array) {
for(var loop = 0; loop < the_images_array.length; loop++)
{
var an_image = new Image();
an_image.src = the_images_array[loop];
}
}
</script>
</HEAD>
<BODY BGCOLOR="000000" TEXT="FFFFFF" LINK="#0000FF" VLINK="#800080" ALINK="#FF0000" TOPMARGIN="0" BORDER=0 leftmargin="0" onload="doPreload();">
<TABLE BORDER="0" CELLPADDING="0" CELLSPACING="0" STYLE="border-collapse: collapse; position:absolute; WIDTH=" HEIGHT="42" background="menuframe/blanker.GIF" bordercolor="#FFFFFF" width="100%">
<TR BORDER="0">
<TD WIDTH="100%" height="30"></TD>
<!-- BTEC -->
<TD WIDTH="90" height="30">
<IMG SRC="menuframe/BTEC1.gif"; NAME='btec' WIDTH="90" HEIGHT="30" onClick="TheImage(5)"></TD>
more code here...
</TR>
more code here.....
</TABLE>
</BODY>
</HTML>
So am i right is it cached? and if not how do i modify it to do so...
Thanks the greatful pig
As I said, this IE glitch seems to show up when arrays are used for preloading - which of course includes the standard MacroMedia code used by Dreamweaver (all those familiar "MM_" functions). This has made for some pretty pokey roll-overs in recent times.
Thanks for your replies.
Microsoft again hmhmhm! I hope they fix this bug soon.
as it seem a pointless exersice in caching them in the first place..
Speed for my size was and is important but i will have to live with it I suppose.
the pig
So in the Table in the body i'm i calling them write?
To do what i want?