473,545 Members | 2,081 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

rollovers not preloading images, why?

Hi,

I have an app that uses rollover images, but the images are still pulled
from the web server during a mouseover instead of being pulled from memory.
The code is as follows:

the javascript:
<script language="JavaS cript">

function MM_findObj(n, d) {
var p,i,x; if(!d) d=document;
if((p=n.indexOf ("?"))>0&&paren t.frames.length ) {
d=parent.frames[n.substring(p+1 )].document; n=n.substring(0 ,p);}
if(!(x=d[n])&&d.all) x=d.all[n]; for (i=0;!x&&i<d.fo rms.length;i++)
x=d.forms[i][n];
for(i=0;!x&&d.l ayers&&i<d.laye rs.length;i++)
x=MM_findObj(n, d.layers[i].document);
if(!x && d.getElementByI d) x=d.getElementB yId(n); return x;
}

function MM_swapImage() {
var i,j=0,x,a=MM_sw apImage.argumen ts; document.MM_sr= new Array;
for(i=0;i<(a.le ngth-2);i+=3)
if ((x=MM_findObj( a[i]))!=null){docum ent.MM_sr[j++]=x; if(!x.oSrc)
x.oSrc=x.src; x.src=a[i+2];}
}
function MM_swapImgResto re() {
var i,x,a=document. MM_sr; for(i=0;a&&i<a. length&&(x=a[i])&&x.oSrc;i++ )
x.src=x.oSrc;
}

if (document.image s) {
tab1_f2 = new Image(150 ,23); tab1_f2.src = "images/tab1_f2.gif";
tab1_f1 = new Image(150 ,23); tab1_f1.src = "images/tab1.gif";
tab6_f2 = new Image(100 ,4); tab6_f2.src = "images/tab6_f2.gif";
tab6_f1 = new Image(100 ,4); tab6_f1.src = "images/tab6.gif";
tab7_f2 = new Image(50 ,4); tab7_f2.src = "images/tab7_f2.gif";
tab7_f1 = new Image(50 ,4); tab7_f1.src = "images/tab7.gif";
tab2_f3 = new Image(129 ,23); tab2_f3.src = "images/tab2_f3.gif";
tab2_f1 = new Image(129 ,23); tab2_f1.src = "images/tab2.gif";
kle_r10_c11_f3 = new Image(45 ,4); kle_r10_c11_f3. src =
"images/kle_r10_c11_f3. gif";
kle_r10_c11_f1 = new Image(45 ,4); kle_r10_c11_f1. src =
"images/kle_r10_c11.gif ";
tab8_f3 = new Image(84 ,4); tab8_f3.src = "images/tab8_f3.gif";
tab8_f1 = new Image(84 ,4); tab8_f1.src = "images/tab8.gif";
tab3_f4 = new Image(169 ,23); tab3_f4.src = "images/tab3_f4.gif";
tab3_f1 = new Image(169 ,23); tab3_f1.src = "images/tab3.gif";
kle_r10_c13_f4 = new Image(46 ,4); kle_r10_c13_f4. src =
"images/kle_r10_c13_f4. gif";
kle_r10_c13_f1 = new Image(46 ,4); kle_r10_c13_f1. src =
"images/kle_r10_c13.gif ";
tab9_f4 = new Image(93 ,4); tab9_f4.src = "images/tab9_f4.gif";
tab9_f1 = new Image(93 ,4); tab9_f1.src = "images/tab9.gif";
tab10_f4 = new Image(30 ,4); tab10_f4.src = "images/tab10_f4.gif";
tab10_f1 = new Image(30 ,4); tab10_f1.src = "images/tab10.gif";
tab4_f5 = new Image(121 ,23); tab4_f5.src = "images/tab4_f5.gif";
tab4_f1 = new Image(121 ,23); tab4_f1.src = "images/tab4.gif";
kle_r10_c16_f5 = new Image(115 ,4); kle_r10_c16_f5. src =
"images/kle_r10_c16_f5. gif";
kle_r10_c16_f1 = new Image(115 ,4); kle_r10_c16_f1. src =
"images/kle_r10_c16.gif ";
tab11_f5 = new Image(6 ,4); tab11_f5.src = "images/tab11_f5.gif";
tab11_f1 = new Image(6 ,4); tab11_f1.src = "images/tab11.gif";
tab5_f6 = new Image(139 ,23); tab5_f6.src = "images/tab5_f6.gif";
tab5_f1 = new Image(139 ,23); tab5_f1.src = "images/tab5.gif";
kle_r10_c20_f6 = new Image(139 ,4); kle_r10_c20_f6. src =
"images/kle_r10_c20_f6. gif";
kle_r10_c20_f1 = new Image(139 ,4); kle_r10_c20_f1. src =
"images/kle_r10_c20.gif ";
tab6_f7 = new Image(100 ,4); tab6_f7.src = "images/tab6_f7.gif";
kle_r12_c4_f7 = new Image(100 ,23); kle_r12_c4_f7.s rc =
"images/kle_r12_c4_f7.g if";
kle_r12_c4_f1 = new Image(100 ,23); kle_r12_c4_f1.s rc =
"images/kle_r12_c4.gif" ;
tab7_f8 = new Image(50 ,4); tab7_f8.src = "images/tab7_f8.gif";
kle_r10_c11_f8 = new Image(45 ,4); kle_r10_c11_f8. src =
"images/kle_r10_c11_f8. gif";
kle_r12_c10_f8 = new Image(95 ,23); kle_r12_c10_f8. src =
"images/kle_r12_c10_f8. gif";
kle_r12_c10_f1 = new Image(95 ,23); kle_r12_c10_f1. src =
"images/kle_r12_c10.gif ";
tab8_f9 = new Image(84 ,4); tab8_f9.src = "images/tab8_f9.gif";
kle_r10_c13_f9 = new Image(46 ,4); kle_r10_c13_f9. src =
"images/kle_r10_c13_f9. gif";
kle_r12_c12_f9 = new Image(130 ,23); kle_r12_c12_f9. src =
"images/kle_r12_c12_f9. gif";
kle_r12_c12_f1 = new Image(130 ,23); kle_r12_c12_f1. src =
"images/kle_r12_c12.gif ";
tab9_f10 = new Image(93 ,4); tab9_f10.src = "images/tab9_f10.gif";
kle_r12_c14_f10 = new Image(93 ,23); kle_r12_c14_f10 .src =
"images/kle_r12_c14_f10 .gif";
kle_r12_c14_f1 = new Image(93 ,23); kle_r12_c14_f1. src =
"images/kle_r12_c14.gif ";
tab10_f11 = new Image(30 ,4); tab10_f11.src = "images/tab10_f11.gif";
kle_r10_c16_f11 = new Image(115 ,4); kle_r10_c16_f11 .src =
"images/kle_r10_c16_f11 .gif";
kle_r12_c15_f11 = new Image(145 ,23); kle_r12_c15_f11 .src =
"images/kle_r12_c15_f11 .gif";
kle_r12_c15_f1 = new Image(145 ,23); kle_r12_c15_f1. src =
"images/kle_r12_c15.gif ";
tab11_f12 = new Image(6 ,4); tab11_f12.src = "images/tab11_f12.gif";
kle_r10_c20_f12 = new Image(139 ,4); kle_r10_c20_f12 .src =
"images/kle_r10_c20_f12 .gif";
kle_r12_c19_f12 = new Image(145 ,23); kle_r12_c19_f12 .src =
"images/kle_r12_c19_f12 .gif";
kle_r12_c19_f1 = new Image(145 ,23); kle_r12_c19_f1. src =
"images/kle_r12_c19.gif ";

}
</script>
THE IMAGE MAP:

<map name="CARTMAP"> <area shape="RECT" coords="0,0,115 ,52"
href="http://kieslerle/cart.aspx" alt="Click Here to view Shopping Cart"
onMouseOut="MM_ swapImage('le_r 2_c10','','../images3/le_r2_c10.gif', 1);"
onMouseOver="MM _swapImage('le_ r2_c10','','../images3/le_r2_c10_f2.gi f',1);">
<area shape="RECT" coords="0,-23,115,29" href="http://kieslerle/cart.aspx"
alt="Click Here to view Shopping Cart"
onMouseOut="MM_ swapImage('le_r 2_c10','','../images3/le_r2_c10.gif', 1);"
onMouseOver="MM _swapImage('le_ r2_c10','','../images3/le_r2_c10_f2.gi f',1);">
<area shape="RECT" coords="-109,-23,6,29" href="http://kieslerle/cart.aspx"
alt="Click Here to view Shopping Cart"
onMouseOut="MM_ swapImage('le_r 2_c10','','../images3/le_r2_c10.gif', 1);"
onMouseOver="MM _swapImage('le_ r2_c10','','../images3/le_r2_c10_f2.gi f',1);">
<area shape="RECT" coords="0,-36,115,16" href="http://kieslerle/cart.aspx"
alt="Click Here to view Shopping Cart"
onMouseOut="MM_ swapImage('le_r 2_c10','','../images3/le_r2_c10.gif', 1);"
onMouseOver="MM _swapImage('le_ r2_c10','','../images3/le_r2_c10_f2.gi f',1);">

<area shape="RECT" coords="-109,-36,6,16" href="http://kieslerle/cart.aspx"
alt="Click Here to view Shopping Cart"
onMouseOut="MM_ swapImage('le_r 2_c10','','../images3/le_r2_c10.gif', 1);"
onMouseOver="MM _swapImage('le_ r2_c10','','../images3/le_r2_c10_f2.gi f',1);">
<area shape="RECT" coords="0,-49,115,3" href="http://kieslerle/cart.aspx"
alt="Click Here to view Shopping Cart"
onMouseOut="MM_ swapImage('le_r 2_c10','','../images3/le_r2_c10.gif', 1);"
onMouseOver="MM _swapImage('le_ r2_c10','','../images3/le_r2_c10_f2.gi f',1);">
</map><map name="m_tab1">< area shape="rect" coords="7,1,142 ,23"
href="http://kieslerle/category.aspx?T ABID=1" alt="Weapons & Ammunition"
onMouseOut="MM_ swapImage('tab1 ','','../images/tab1.gif','tab6 ','','../images
/tab6.gif','tab7 ','','../images/tab7.gif',1);"
onMouseOver="MM _swapImage('tab 1','','../images/tab1_f2.gif','t ab6','','../im
ages/tab6_f2.gif','t ab7','','../images/tab7_f2.gif',1) ;" ></map><map
name="m_tab2">< area shape="rect" coords="7,1,122 ,23"
href="http://kieslerle/category.aspx?T ABID=2" alt="Weapon Accessories"
onMouseOut="MM_ swapImage('tab2 ','','../images/tab2.gif','kle_ r10_c11','','..
/images/kle_r10_c11.gif ','tab8','','../images/tab8.gif',1);"
onMouseOver="MM _swapImage('tab 2','','../images/tab2_f3.gif','k le_r10_c11',''
,'../images/kle_r10_c11_f3. gif','tab8','', '../images/tab8_f3.gif',1) ;"
</map><map name="m_tab3">< area shape="rect" coords="7,1,162 ,23" href="http://kieslerle/category.aspx?T ABID=3" alt="Shields, Armor &
Protection"
onMouseOut="MM_ swapImage('tab3 ','','../images/tab3.gif','kle_ r10_c13','','..
/images/kle_r10_c13.gif ','tab9','','../images/tab9.gif','tab1 0','','../image
s/tab10.gif',1);"
onMouseOver="MM _swapImage('tab 3','','../images/tab3_f4.gif','k le_r10_c13',''
,'../images/kle_r10_c13_f4. gif','tab9','', '../images/tab9_f4.gif','t ab10',''
,'../images/tab10_f4.gif',1 );" ></map><map name="m_tab4">< area shape="rect"
coords="7,1,115 ,23" href="http://kieslerle/category.aspx?T ABID=4"
alt="Training & Survival"
onMouseOut="MM_ swapImage('tab4 ','','../images/tab4.gif','kle_ r10_c16','','..
/images/kle_r10_c16.gif ','tab11','','. ./images/tab11.gif',1);"
onMouseOver="MM _swapImage('tab 4','','../images/tab4_f5.gif','k le_r10_c16',''
,'../images/kle_r10_c16_f5. gif','tab11','' ,'../images/tab11_f5.gif',1 );"</map><map name="m_tab5">< area shape="rect" coords="6,1,133 ,23"

href="http://kieslerle/category.aspx?T ABID=5" alt="Optics, Lights & Vision"
onMouseOut="MM_ swapImage('tab5 ','','../images/tab5.gif','kle_ r10_c20','','..
/images/kle_r10_c20.gif ',1);"
onMouseOver="MM _swapImage('tab 5','','../images/tab5_f6.gif','k le_r10_c20',''
,'../images/kle_r10_c20_f6. gif',1);" ></map><map name="m_tab6">< area
shape="rect" coords="6,3,94, 26"
href="http://kieslerle/category.aspx?T ABID=6" alt="Tactical & Duty"
onMouseOut="MM_ swapImage('tab6 ','','../images/tab6.gif','kle_ r12_c4','','../
images/kle_r12_c4.gif' ,1);"
onMouseOver="MM _swapImage('tab 6','','../images/tab6_f7.gif','k le_r12_c4','',
'../images/kle_r12_c4_f7.g if',1);" ></map><map name="m_kle_r12 _c4"><area
shape="rect" coords="6,-1,94,22"
href="http://kieslerle/category.aspx?T ABID=6" alt="Tactical & Duty"
onMouseOut="MM_ swapImage('tab6 ','','../images/tab6.gif','kle_ r12_c4','','../
images/kle_r12_c4.gif' ,1);"
onMouseOver="MM _swapImage('tab 6','','../images/tab6_f7.gif','k le_r12_c4','',
'../images/kle_r12_c4_f7.g if',1);" ></map><map name="m_tab7">< area
shape="rect" coords="6,3,89, 26"
href="http://kieslerle/category.aspx?T ABID=7" alt="Knives & Tools"
onMouseOut="MM_ swapImage('tab7 ','','../images/tab7.gif','kle_ r10_c11','','..
/images/kle_r10_c11.gif ','kle_r12_c10' ,'','../images/kle_r12_c10.gif ',1);"
onMouseOver="MM _swapImage('tab 7','','../images/tab7_f8.gif','k le_r10_c11',''
,'../images/kle_r10_c11_f8. gif','kle_r12_c 10','','../images/kle_r12_c10_f8. g
if',1);" ></map><map name="m_kle_r10 _c11"><area shape="rect"
coords="-44,3,39,26" href="http://kieslerle/category.aspx?T ABID=7"
alt="Knives & Tools"
onMouseOut="MM_ swapImage('tab7 ','','../images/tab7.gif','kle_ r10_c11','','..
/images/kle_r10_c11.gif ','kle_r12_c10' ,'','../images/kle_r12_c10.gif ',1);"
onMouseOver="MM _swapImage('tab 7','','../images/tab7_f8.gif','k le_r10_c11',''
,'../images/kle_r10_c11_f8. gif','kle_r12_c 10','','../images/kle_r12_c10_f8. g
if',1);" ></map><map name="m_kle_r12 _c10"><area shape="rect"
coords="6,-1,89,22" href="http://kieslerle/category.aspx?T ABID=7"
alt="Knives & Tools"
onMouseOut="MM_ swapImage('tab7 ','','../images/tab7.gif','kle_ r10_c11','','..
/images/kle_r10_c11.gif ','kle_r12_c10' ,'','../images/kle_r12_c10.gif ',1);"
onMouseOver="MM _swapImage('tab 7','','../images/tab7_f8.gif','k le_r10_c11',''
,'../images/kle_r10_c11_f8. gif','kle_r12_c 10','','../images/kle_r12_c10_f8. g
if',1);" ></map><map name="m_tab8">< area shape="rect" coords="6,3,125 ,26"
href="http://kieslerle/category.aspx?T ABID=8" alt="Specialty Equipment"
onMouseOut="MM_ swapImage('tab8 ','','../images/tab8.gif','kle_ r10_c13','','..
/images/kle_r10_c13.gif ','kle_r12_c12' ,'','../images/kle_r12_c12.gif ',1);"
onMouseOver="MM _swapImage('tab 8','','../images/tab8_f9.gif','k le_r10_c13',''
,'../images/kle_r10_c13_f9. gif','kle_r12_c 12','','../images/kle_r12_c12_f9. g
if',1);" ></map><map name="m_kle_r10 _c13"><area shape="rect"
coords="-78,3,41,26" href="http://kieslerle/category.aspx?T ABID=8"
alt="Specialty Equipment"
onMouseOut="MM_ swapImage('tab8 ','','../images/tab8.gif','kle_ r10_c13','','..
/images/kle_r10_c13.gif ','kle_r12_c12' ,'','../images/kle_r12_c12.gif ',1);"
onMouseOver="MM _swapImage('tab 8','','../images/tab8_f9.gif','k le_r10_c13',''
,'../images/kle_r10_c13_f9. gif','kle_r12_c 12','','../images/kle_r12_c12_f9. g
if',1);" ></map><map name="m_kle_r12 _c12"><area shape="rect"
coords="6,-1,125,22" href="http://kieslerle/category.aspx?T ABID=8"
alt="Specialty Equipment"
onMouseOut="MM_ swapImage('tab8 ','','../images/tab8.gif','kle_ r10_c13','','..
/images/kle_r10_c13.gif ','kle_r12_c12' ,'','../images/kle_r12_c12.gif ',1);"
onMouseOver="MM _swapImage('tab 8','','../images/tab8_f9.gif','k le_r10_c13',''
,'../images/kle_r10_c13_f9. gif','kle_r12_c 12','','../images/kle_r12_c12_f9. g
if',1);" ></map><map name="m_tab9">< area shape="rect" coords="6,3,87, 26"
href="http://kieslerle/category.aspx?T ABID=9" alt="Miscellane ous"
onMouseOut="MM_ swapImage('tab9 ','','../images/tab9.gif','kle_ r12_c14','','..
/images/kle_r12_c14.gif ',1);"
onMouseOver="MM _swapImage('tab 9','','../images/tab9_f10.gif',' kle_r12_c14','
','../images/kle_r12_c14_f10 .gif',1);" ></map><map
name="m_kle_r12 _c14"><area shape="rect" coords="6,-1,87,22"
href="http://kieslerle/category.aspx?T ABID=9" alt="Miscellane ous"
onMouseOut="MM_ swapImage('tab9 ','','../images/tab9.gif','kle_ r12_c14','','..
/images/kle_r12_c14.gif ',1);"
onMouseOver="MM _swapImage('tab 9','','../images/tab9_f10.gif',' kle_r12_c14','
','../images/kle_r12_c14_f10 .gif',1);" ></map><map name="m_tab10"> <area
shape="rect" coords="6,3,138 ,26"
href="http://kieslerle/category.aspx?T ABID=10" alt="Government & Military"
onMouseOut="MM_ swapImage('tab1 0','','../images/tab10.gif','kle _r10_c16','','
.../images/kle_r10_c16.gif ','kle_r12_c15' ,'','../images/kle_r12_c15.gif ',1);"
onMouseOver="MM _swapImage('tab 10','','../images/tab10_f11.gif', 'kle_r10_c16'
,'','../images/kle_r10_c16_f11 .gif','kle_r12_ c15','','../images/kle_r12_c15_
f11.gif',1);" ></map><map name="m_kle_r10 _c16"><area shape="rect"
coords="-24,3,108,26" href="http://kieslerle/category.aspx?T ABID=10"
alt="Government & Military"
onMouseOut="MM_ swapImage('tab1 0','','../images/tab10.gif','kle _r10_c16','','
.../images/kle_r10_c16.gif ','kle_r12_c15' ,'','../images/kle_r12_c15.gif ',1);"
onMouseOver="MM _swapImage('tab 10','','../images/tab10_f11.gif', 'kle_r10_c16'
,'','../images/kle_r10_c16_f11 .gif','kle_r12_ c15','','../images/kle_r12_c15_
f11.gif',1);" ></map><map name="m_kle_r12 _c15"><area shape="rect"
coords="6,-1,138,22" href="http://kieslerle/category.aspx?T ABID=10"
alt="Government & Military"
onMouseOut="MM_ swapImage('tab1 0','','../images/tab10.gif','kle _r10_c16','','
.../images/kle_r10_c16.gif ','kle_r12_c15' ,'','../images/kle_r12_c15.gif ',1);"
onMouseOver="MM _swapImage('tab 10','','../images/tab10_f11.gif', 'kle_r10_c16'
,'','../images/kle_r10_c16_f11 .gif','kle_r12_ c15','','../images/kle_r12_c15_
f11.gif',1);" ></map><map name="m_tab11"> <area shape="rect"
coords="5,3,139 ,26" href="http://kieslerle/business.aspx?T ABID=11"
alt="Doing Business With Kieslers"
onMouseOut="MM_ swapImage('tab1 1','','../images/tab11.gif','kle _r10_c20','','
.../images/kle_r10_c20.gif ','kle_r12_c19' ,'','../images/kle_r12_c19.gif ',1);"
onMouseOver="MM _swapImage('tab 11','','../images/tab11_f12.gif', 'kle_r10_c20'
,'','../images/kle_r10_c20_f12 .gif','kle_r12_ c19','','../images/kle_r12_c19_
f12.gif',1);" ></map><map name="m_kle_r10 _c20"><area shape="rect"
coords="-1,3,133,26" href="http://kieslerle/business.aspx?T ABID=11"
alt="Doing Business With Kieslers"
onMouseOut="MM_ swapImage('tab1 1','','../images/tab11.gif','kle _r10_c20','','
.../images/kle_r10_c20.gif ','kle_r12_c19' ,'','../images/kle_r12_c19.gif ',1);"
onMouseOver="MM _swapImage('tab 11','','../images/tab11_f12.gif', 'kle_r10_c20'
,'','../images/kle_r10_c20_f12 .gif','kle_r12_ c19','','../images/kle_r12_c19_
f12.gif',1);" ></map><map name="m_kle_r12 _c19"><area shape="rect"
coords="5,-1,139,22" href="http://kieslerle/business.aspx?T ABID=11"
alt="Doing Business With Kieslers"
onMouseOut="MM_ swapImage('tab1 1','','../images/tab11.gif','kle _r10_c20','','
.../images/kle_r10_c20.gif ','kle_r12_c19' ,'','../images/kle_r12_c19.gif ',1);"
onMouseOver="MM _swapImage('tab 11','','../images/tab11_f12.gif', 'kle_r10_c20'
,'','../images/kle_r10_c20_f12 .gif','kle_r12_ c19','','../images/kle_r12_c19_
f12.gif',1);" ></map>

THE TABLE CONTAINING THE IMAGES THAT ROLLOVER:

<table border="0" cellpadding="0" cellspacing="0" width="708"><tr ><td><table
border="0" cellpadding="0" cellspacing="0" width="708"><tr ><td><img
name="tab1" src="../images/tab1.gif" width="150" height="23" border="0"
usemap="#m_tab1 " alt=""></td><td><img name="tab2" src="../images/tab2.gif"
width="129" height="23" border="0" usemap="#m_tab2 " alt=""></td><td><img
name="tab3" src="../images/tab3.gif" width="169" height="23" border="0"
usemap="#m_tab3 " alt=""></td><td><img name="tab4" src="../images/tab4.gif"
width="121" height="23" border="0" usemap="#m_tab4 " alt=""></td><td><img
name="tab5" src="../images/tab5.gif" width="139" height="23" border="0"
usemap="#m_tab5 " alt=""></td></tr></table></td></tr><tr><td><tab le
border="0" cellpadding="0" cellspacing="0" width="708"><tr ><td><img
name="tab6" src="../images/tab6.gif" width="100" height="4" border="0"
usemap="#m_tab6 " alt=""></td><td><img name="tab7" src="../images/tab7.gif"
width="50" height="4" border="0" usemap="#m_tab7 " alt=""></td><td><img
name="kle_r10_c 11" src="../images/kle_r10_c11.gif " width="45" height="4"
border="0" usemap="#m_kle_ r10_c11" alt=""></td><td><img name="tab8"
src="../images/tab8.gif" width="84" height="4" border="0" usemap="#m_tab8 "
alt=""></td><td><img name="kle_r10_c 13" src="../images/kle_r10_c13.gif "
width="46" height="4" border="0" usemap="#m_kle_ r10_c13"
alt=""></td><td><img name="tab9" src="../images/tab9.gif" width="93"
height="4" border="0" usemap="#m_tab9 " alt=""></td><td><img name="tab10"
src="../images/tab10.gif" width="30" height="4" border="0" usemap="#m_tab1 0"
alt=""></td><td><img name="kle_r10_c 16" src="../images/kle_r10_c16.gif "
width="115" height="4" border="0" usemap="#m_kle_ r10_c16"
alt=""></td><td><img name="tab11" src="../images/tab11.gif" width="6"
height="4" border="0" usemap="#m_tab1 1" alt=""></td><td><img
name="kle_r10_c 20" src="../images/kle_r10_c20.gif " width="139" height="4"
border="0" usemap="#m_kle_ r10_c20"
alt=""></td></tr></table></td></tr><tr><td><tab le border="0" cellpadding="0"
cellspacing="0" width="708"><tr ><td><img name="kle_r12_c 4"
src="../images/kle_r12_c4.gif" width="100" height="23" border="0"
usemap="#m_kle_ r12_c4" alt=""></td><td><img name="kle_r12_c 10"
src="../images/kle_r12_c10.gif " width="95" height="23" border="0"
usemap="#m_kle_ r12_c10" alt=""></td><td><img name="kle_r12_c 12"
src="../images/kle_r12_c12.gif " width="130" height="23" border="0"
usemap="#m_kle_ r12_c12" alt=""></td><td><img name="kle_r12_c 14"
src="../images/kle_r12_c14.gif " width="93" height="23" border="0"
usemap="#m_kle_ r12_c14" alt=""></td><td><img name="kle_r12_c 15"
src="../images/kle_r12_c15.gif " width="145" height="23" border="0"
usemap="#m_kle_ r12_c15" alt=""></td><td><img name="kle_r12_c 19"
src="../images/kle_r12_c19.gif " width="145" height="23" border="0"
usemap="#m_kle_ r12_c19" alt=""></td></tr></table></td></tr></table>
Any help or direction of how to cache images using an image map would be
greatly appreciated.

TIA

Dave

Jul 23 '05 #1
3 1315
Hi,

I have an app that uses rollover images, but the images are still pulled
from the web server during a mouseover instead of being pulled from memory. The code is as follows:
Sheesh.

Try to provide the simplest example that demonstrates the problem. Who
wants to go through all that?

<snip Dreamweaver crap)

tab1_f2 = new Image(150 ,23); tab1_f2.src = "images/tab1_f2.gif";
the path here is relative to the current directory
('le_r2_c10','' ,'../images3/le_r2_c10_f2.gi f',1);">

That path here is absolute to the root.

Where are the images and where is the page? Could that be your "problem"?

Jeff
<area shape="RECT" coords="0,-23,115,29" href="http://kieslerle/cart.aspx"
alt="Click Here to view Shopping Cart"
onMouseOut="MM_ swapImage('le_r 2_c10','','../images3/le_r2_c10.gif', 1);"
onMouseOver="MM _swapImage('le_ r2_c10','','../images3/le_r2_c10_f2.gi f',1);"> <area shape="RECT" coords="-109,-23,6,29" href="http://kieslerle/cart.aspx" alt="Click Here to view Shopping Cart"
onMouseOut="MM_ swapImage('le_r 2_c10','','../images3/le_r2_c10.gif', 1);"
onMouseOver="MM _swapImage('le_ r2_c10','','../images3/le_r2_c10_f2.gi f',1);"> <area shape="RECT" coords="0,-36,115,16" href="http://kieslerle/cart.aspx"
alt="Click Here to view Shopping Cart"
onMouseOut="MM_ swapImage('le_r 2_c10','','../images3/le_r2_c10.gif', 1);"
onMouseOver="MM _swapImage('le_ r2_c10','','../images3/le_r2_c10_f2.gi f',1);">
<area shape="RECT" coords="-109,-36,6,16" href="http://kieslerle/cart.aspx" alt="Click Here to view Shopping Cart"
onMouseOut="MM_ swapImage('le_r 2_c10','','../images3/le_r2_c10.gif', 1);"
onMouseOver="MM _swapImage('le_ r2_c10','','../images3/le_r2_c10_f2.gi f',1);"> <area shape="RECT" coords="0,-49,115,3" href="http://kieslerle/cart.aspx"
alt="Click Here to view Shopping Cart"
onMouseOut="MM_ swapImage('le_r 2_c10','','../images3/le_r2_c10.gif', 1);"
onMouseOver="MM _swapImage('le_ r2_c10','','../images3/le_r2_c10_f2.gi f',1);"> </map><map name="m_tab1">< area shape="rect" coords="7,1,142 ,23"
href="http://kieslerle/category.aspx?T ABID=1" alt="Weapons & Ammunition"
onMouseOut="MM_ swapImage('tab1 ','','../images/tab1.gif','tab6 ','','../images /tab6.gif','tab7 ','','../images/tab7.gif',1);"
onMouseOver="MM _swapImage('tab 1','','../images/tab1_f2.gif','t ab6','','../im ages/tab6_f2.gif','t ab7','','../images/tab7_f2.gif',1) ;" ></map><map
name="m_tab2">< area shape="rect" coords="7,1,122 ,23"
href="http://kieslerle/category.aspx?T ABID=2" alt="Weapon Accessories"
onMouseOut="MM_ swapImage('tab2 ','','../images/tab2.gif','kle_ r10_c11','','.. /images/kle_r10_c11.gif ','tab8','','../images/tab8.gif',1);"
onMouseOver="MM _swapImage('tab 2','','../images/tab2_f3.gif','k le_r10_c11','' ,'../images/kle_r10_c11_f3. gif','tab8','', '../images/tab8_f3.gif',1) ;"
</map><map name="m_tab3">< area shape="rect" coords="7,1,162 ,23" href="http://kieslerle/category.aspx?T ABID=3" alt="Shields, Armor &
Protection"

onMouseOut="MM_ swapImage('tab3 ','','../images/tab3.gif','kle_ r10_c13','','.. /images/kle_r10_c13.gif ','tab9','','../images/tab9.gif','tab1 0','','../image s/tab10.gif',1);"
onMouseOver="MM _swapImage('tab 3','','../images/tab3_f4.gif','k le_r10_c13','' ,'../images/kle_r10_c13_f4. gif','tab9','', '../images/tab9_f4.gif','t ab10','' ,'../images/tab10_f4.gif',1 );" ></map><map name="m_tab4">< area shape="rect" coords="7,1,115 ,23" href="http://kieslerle/category.aspx?T ABID=4"
alt="Training & Survival"
onMouseOut="MM_ swapImage('tab4 ','','../images/tab4.gif','kle_ r10_c16','','.. /images/kle_r10_c16.gif ','tab11','','. ./images/tab11.gif',1);"
onMouseOver="MM _swapImage('tab 4','','../images/tab4_f5.gif','k le_r10_c16','' ,'../images/kle_r10_c16_f5. gif','tab11','' ,'../images/tab11_f5.gif',1 );"
</map><map name="m_tab5">< area shape="rect" coords="6,1,133 ,23" href="http://kieslerle/category.aspx?T ABID=5" alt="Optics, Lights &

Vision" onMouseOut="MM_ swapImage('tab5 ','','../images/tab5.gif','kle_ r10_c20','','.. /images/kle_r10_c20.gif ',1);"
onMouseOver="MM _swapImage('tab 5','','../images/tab5_f6.gif','k le_r10_c20','' ,'../images/kle_r10_c20_f6. gif',1);" ></map><map name="m_tab6">< area
shape="rect" coords="6,3,94, 26"
href="http://kieslerle/category.aspx?T ABID=6" alt="Tactical & Duty"
onMouseOut="MM_ swapImage('tab6 ','','../images/tab6.gif','kle_ r12_c4','','../ images/kle_r12_c4.gif' ,1);"
onMouseOver="MM _swapImage('tab 6','','../images/tab6_f7.gif','k le_r12_c4','', '../images/kle_r12_c4_f7.g if',1);" ></map><map name="m_kle_r12 _c4"><area
shape="rect" coords="6,-1,94,22"
href="http://kieslerle/category.aspx?T ABID=6" alt="Tactical & Duty"
onMouseOut="MM_ swapImage('tab6 ','','../images/tab6.gif','kle_ r12_c4','','../ images/kle_r12_c4.gif' ,1);"
onMouseOver="MM _swapImage('tab 6','','../images/tab6_f7.gif','k le_r12_c4','', '../images/kle_r12_c4_f7.g if',1);" ></map><map name="m_tab7">< area
shape="rect" coords="6,3,89, 26"
href="http://kieslerle/category.aspx?T ABID=7" alt="Knives & Tools"
onMouseOut="MM_ swapImage('tab7 ','','../images/tab7.gif','kle_ r10_c11','','.. /images/kle_r10_c11.gif ','kle_r12_c10' ,'','../images/kle_r12_c10.gif ',1);"
onMouseOver="MM _swapImage('tab 7','','../images/tab7_f8.gif','k le_r10_c11','' ,'../images/kle_r10_c11_f8. gif','kle_r12_c 10','','../images/kle_r12_c10_f8. g if',1);" ></map><map name="m_kle_r10 _c11"><area shape="rect"
coords="-44,3,39,26" href="http://kieslerle/category.aspx?T ABID=7"
alt="Knives & Tools"
onMouseOut="MM_ swapImage('tab7 ','','../images/tab7.gif','kle_ r10_c11','','.. /images/kle_r10_c11.gif ','kle_r12_c10' ,'','../images/kle_r12_c10.gif ',1);"
onMouseOver="MM _swapImage('tab 7','','../images/tab7_f8.gif','k le_r10_c11','' ,'../images/kle_r10_c11_f8. gif','kle_r12_c 10','','../images/kle_r12_c10_f8. g if',1);" ></map><map name="m_kle_r12 _c10"><area shape="rect"
coords="6,-1,89,22" href="http://kieslerle/category.aspx?T ABID=7"
alt="Knives & Tools"
onMouseOut="MM_ swapImage('tab7 ','','../images/tab7.gif','kle_ r10_c11','','.. /images/kle_r10_c11.gif ','kle_r12_c10' ,'','../images/kle_r12_c10.gif ',1);"
onMouseOver="MM _swapImage('tab 7','','../images/tab7_f8.gif','k le_r10_c11','' ,'../images/kle_r10_c11_f8. gif','kle_r12_c 10','','../images/kle_r12_c10_f8. g if',1);" ></map><map name="m_tab8">< area shape="rect" coords="6,3,125 ,26"
href="http://kieslerle/category.aspx?T ABID=8" alt="Specialty Equipment"
onMouseOut="MM_ swapImage('tab8 ','','../images/tab8.gif','kle_ r10_c13','','.. /images/kle_r10_c13.gif ','kle_r12_c12' ,'','../images/kle_r12_c12.gif ',1);"
onMouseOver="MM _swapImage('tab 8','','../images/tab8_f9.gif','k le_r10_c13','' ,'../images/kle_r10_c13_f9. gif','kle_r12_c 12','','../images/kle_r12_c12_f9. g if',1);" ></map><map name="m_kle_r10 _c13"><area shape="rect"
coords="-78,3,41,26" href="http://kieslerle/category.aspx?T ABID=8"
alt="Specialty Equipment"
onMouseOut="MM_ swapImage('tab8 ','','../images/tab8.gif','kle_ r10_c13','','.. /images/kle_r10_c13.gif ','kle_r12_c12' ,'','../images/kle_r12_c12.gif ',1);"
onMouseOver="MM _swapImage('tab 8','','../images/tab8_f9.gif','k le_r10_c13','' ,'../images/kle_r10_c13_f9. gif','kle_r12_c 12','','../images/kle_r12_c12_f9. g if',1);" ></map><map name="m_kle_r12 _c12"><area shape="rect"
coords="6,-1,125,22" href="http://kieslerle/category.aspx?T ABID=8"
alt="Specialty Equipment"
onMouseOut="MM_ swapImage('tab8 ','','../images/tab8.gif','kle_ r10_c13','','.. /images/kle_r10_c13.gif ','kle_r12_c12' ,'','../images/kle_r12_c12.gif ',1);"
onMouseOver="MM _swapImage('tab 8','','../images/tab8_f9.gif','k le_r10_c13','' ,'../images/kle_r10_c13_f9. gif','kle_r12_c 12','','../images/kle_r12_c12_f9. g if',1);" ></map><map name="m_tab9">< area shape="rect" coords="6,3,87, 26"
href="http://kieslerle/category.aspx?T ABID=9" alt="Miscellane ous"
onMouseOut="MM_ swapImage('tab9 ','','../images/tab9.gif','kle_ r12_c14','','.. /images/kle_r12_c14.gif ',1);"
onMouseOver="MM _swapImage('tab 9','','../images/tab9_f10.gif',' kle_r12_c14',' ','../images/kle_r12_c14_f10 .gif',1);" ></map><map
name="m_kle_r12 _c14"><area shape="rect" coords="6,-1,87,22"
href="http://kieslerle/category.aspx?T ABID=9" alt="Miscellane ous"
onMouseOut="MM_ swapImage('tab9 ','','../images/tab9.gif','kle_ r12_c14','','.. /images/kle_r12_c14.gif ',1);"
onMouseOver="MM _swapImage('tab 9','','../images/tab9_f10.gif',' kle_r12_c14',' ','../images/kle_r12_c14_f10 .gif',1);" ></map><map name="m_tab10"> <area
shape="rect" coords="6,3,138 ,26"
href="http://kieslerle/category.aspx?T ABID=10" alt="Government & Military"
onMouseOut="MM_ swapImage('tab1 0','','../images/tab10.gif','kle _r10_c16','',' .../images/kle_r10_c16.gif ','kle_r12_c15' ,'','../images/kle_r12_c15.gif ',1);" onMouseOver="MM _swapImage('tab 10','','../images/tab10_f11.gif', 'kle_r10_c16' ,'','../images/kle_r10_c16_f11 .gif','kle_r12_ c15','','../images/kle_r12_c15_ f11.gif',1);" ></map><map name="m_kle_r10 _c16"><area shape="rect"
coords="-24,3,108,26" href="http://kieslerle/category.aspx?T ABID=10"
alt="Government & Military"
onMouseOut="MM_ swapImage('tab1 0','','../images/tab10.gif','kle _r10_c16','',' .../images/kle_r10_c16.gif ','kle_r12_c15' ,'','../images/kle_r12_c15.gif ',1);" onMouseOver="MM _swapImage('tab 10','','../images/tab10_f11.gif', 'kle_r10_c16' ,'','../images/kle_r10_c16_f11 .gif','kle_r12_ c15','','../images/kle_r12_c15_ f11.gif',1);" ></map><map name="m_kle_r12 _c15"><area shape="rect"
coords="6,-1,138,22" href="http://kieslerle/category.aspx?T ABID=10"
alt="Government & Military"
onMouseOut="MM_ swapImage('tab1 0','','../images/tab10.gif','kle _r10_c16','',' .../images/kle_r10_c16.gif ','kle_r12_c15' ,'','../images/kle_r12_c15.gif ',1);" onMouseOver="MM _swapImage('tab 10','','../images/tab10_f11.gif', 'kle_r10_c16' ,'','../images/kle_r10_c16_f11 .gif','kle_r12_ c15','','../images/kle_r12_c15_ f11.gif',1);" ></map><map name="m_tab11"> <area shape="rect"
coords="5,3,139 ,26" href="http://kieslerle/business.aspx?T ABID=11"
alt="Doing Business With Kieslers"
onMouseOut="MM_ swapImage('tab1 1','','../images/tab11.gif','kle _r10_c20','',' .../images/kle_r10_c20.gif ','kle_r12_c19' ,'','../images/kle_r12_c19.gif ',1);" onMouseOver="MM _swapImage('tab 11','','../images/tab11_f12.gif', 'kle_r10_c20' ,'','../images/kle_r10_c20_f12 .gif','kle_r12_ c19','','../images/kle_r12_c19_ f12.gif',1);" ></map><map name="m_kle_r10 _c20"><area shape="rect"
coords="-1,3,133,26" href="http://kieslerle/business.aspx?T ABID=11"
alt="Doing Business With Kieslers"
onMouseOut="MM_ swapImage('tab1 1','','../images/tab11.gif','kle _r10_c20','',' .../images/kle_r10_c20.gif ','kle_r12_c19' ,'','../images/kle_r12_c19.gif ',1);" onMouseOver="MM _swapImage('tab 11','','../images/tab11_f12.gif', 'kle_r10_c20' ,'','../images/kle_r10_c20_f12 .gif','kle_r12_ c19','','../images/kle_r12_c19_ f12.gif',1);" ></map><map name="m_kle_r12 _c19"><area shape="rect"
coords="5,-1,139,22" href="http://kieslerle/business.aspx?T ABID=11"
alt="Doing Business With Kieslers"
onMouseOut="MM_ swapImage('tab1 1','','../images/tab11.gif','kle _r10_c20','',' .../images/kle_r10_c20.gif ','kle_r12_c19' ,'','../images/kle_r12_c19.gif ',1);" onMouseOver="MM _swapImage('tab 11','','../images/tab11_f12.gif', 'kle_r10_c20' ,'','../images/kle_r10_c20_f12 .gif','kle_r12_ c19','','../images/kle_r12_c19_ f12.gif',1);" ></map>

THE TABLE CONTAINING THE IMAGES THAT ROLLOVER:

<table border="0" cellpadding="0" cellspacing="0" width="708"><tr ><td><table border="0" cellpadding="0" cellspacing="0" width="708"><tr ><td><img
name="tab1" src="../images/tab1.gif" width="150" height="23" border="0"
usemap="#m_tab1 " alt=""></td><td><img name="tab2" src="../images/tab2.gif"
width="129" height="23" border="0" usemap="#m_tab2 " alt=""></td><td><img
name="tab3" src="../images/tab3.gif" width="169" height="23" border="0"
usemap="#m_tab3 " alt=""></td><td><img name="tab4" src="../images/tab4.gif"
width="121" height="23" border="0" usemap="#m_tab4 " alt=""></td><td><img
name="tab5" src="../images/tab5.gif" width="139" height="23" border="0"
usemap="#m_tab5 " alt=""></td></tr></table></td></tr><tr><td><tab le
border="0" cellpadding="0" cellspacing="0" width="708"><tr ><td><img
name="tab6" src="../images/tab6.gif" width="100" height="4" border="0"
usemap="#m_tab6 " alt=""></td><td><img name="tab7" src="../images/tab7.gif"
width="50" height="4" border="0" usemap="#m_tab7 " alt=""></td><td><img
name="kle_r10_c 11" src="../images/kle_r10_c11.gif " width="45" height="4"
border="0" usemap="#m_kle_ r10_c11" alt=""></td><td><img name="tab8"
src="../images/tab8.gif" width="84" height="4" border="0" usemap="#m_tab8 "
alt=""></td><td><img name="kle_r10_c 13" src="../images/kle_r10_c13.gif "
width="46" height="4" border="0" usemap="#m_kle_ r10_c13"
alt=""></td><td><img name="tab9" src="../images/tab9.gif" width="93"
height="4" border="0" usemap="#m_tab9 " alt=""></td><td><img name="tab10"
src="../images/tab10.gif" width="30" height="4" border="0" usemap="#m_tab1 0" alt=""></td><td><img name="kle_r10_c 16" src="../images/kle_r10_c16.gif "
width="115" height="4" border="0" usemap="#m_kle_ r10_c16"
alt=""></td><td><img name="tab11" src="../images/tab11.gif" width="6"
height="4" border="0" usemap="#m_tab1 1" alt=""></td><td><img
name="kle_r10_c 20" src="../images/kle_r10_c20.gif " width="139" height="4"
border="0" usemap="#m_kle_ r10_c20"
alt=""></td></tr></table></td></tr><tr><td><tab le border="0" cellpadding="0" cellspacing="0" width="708"><tr ><td><img name="kle_r12_c 4"
src="../images/kle_r12_c4.gif" width="100" height="23" border="0"
usemap="#m_kle_ r12_c4" alt=""></td><td><img name="kle_r12_c 10"
src="../images/kle_r12_c10.gif " width="95" height="23" border="0"
usemap="#m_kle_ r12_c10" alt=""></td><td><img name="kle_r12_c 12"
src="../images/kle_r12_c12.gif " width="130" height="23" border="0"
usemap="#m_kle_ r12_c12" alt=""></td><td><img name="kle_r12_c 14"
src="../images/kle_r12_c14.gif " width="93" height="23" border="0"
usemap="#m_kle_ r12_c14" alt=""></td><td><img name="kle_r12_c 15"
src="../images/kle_r12_c15.gif " width="145" height="23" border="0"
usemap="#m_kle_ r12_c15" alt=""></td><td><img name="kle_r12_c 19"
src="../images/kle_r12_c19.gif " width="145" height="23" border="0"
usemap="#m_kle_ r12_c19" alt=""></td></tr></table></td></tr></table>
Any help or direction of how to cache images using an image map would be
greatly appreciated.

TIA

Dave

Jul 23 '05 #2
Hi Jeff,
Sorry about the mess. I put together a simple example (autogenerated with
Fireworks). Basically, instead of using a simple rollover, it uses a an
image map for each tab/button.

go to http://www.miraclecat.com/test/rollover.htm for a simple 2 button
example (using an image map)
http://www.miraclecat.com/test/rollover2.htm for the same example without
the image map.

rollover.htm:
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">

<html>
<head>
<title>Untitled </title>
</head>

<body>
<script language="JavaS cript">
<!-- hide
function MM_findObj(n, d) { //v4.01
var p,i,x; if(!d) d=document;
if((p=n.indexOf ("?"))>0&&paren t.frames.length ) {
d=parent.frames[n.substring(p+1 )].document; n=n.substring(0 ,p);}
if(!(x=d[n])&&d.all) x=d.all[n]; for (i=0;!x&&i<d.fo rms.length;i++)
x=d.forms[i][n];
for(i=0;!x&&d.l ayers&&i<d.laye rs.length;i++)
x=MM_findObj(n, d.layers[i].document);
if(!x && d.getElementByI d) x=d.getElementB yId(n); return x;
}

function MM_swapImage() { //v3.0
var i,j=0,x,a=MM_sw apImage.argumen ts; document.MM_sr= new Array;
for(i=0;i<(a.le ngth-2);i+=3)
if ((x=MM_findObj( a[i]))!=null){docum ent.MM_sr[j++]=x; if(!x.oSrc)
x.oSrc=x.src; x.src=a[i+2];}
}

if (document.image s) {
test_r2_c2_f2 = new Image(75 ,31); test_r2_c2_f2.s rc =
"images/test_r2_c2_f2.g if";
test_r2_c2_f1 = new Image(75 ,31); test_r2_c2_f1.s rc =
"images/test_r2_c2.gif" ;
test_r2_c4_f2 = new Image(75 ,31); test_r2_c4_f2.s rc =
"images/test_r2_c4_f2.g if";
test_r2_c4_f1 = new Image(75 ,31); test_r2_c4_f1.s rc =
"images/test_r2_c4.gif" ;
}
// stop hiding -->
</script>
<table border="0" cellpadding="0" cellspacing="0" width="200">
<tr>
<td colspan="5"><im g name="test_r1_c 1" src="images/test_r1_c1.gif"
width="200" height="50" border="0" alt=""></td>
</tr>
<tr>
<td rowspan="2"><im g name="test_r2_c 1" src="images/test_r2_c1.gif"
width="12" height="150" border="0" alt=""></td>
<td><img name="test_r2_c 2" src="images/test_r2_c2.gif" width="75"
height="31" border="0" usemap="#m_test _r2_c2" alt=""></td>
<td rowspan="2"><im g name="test_r2_c 3" src="images/test_r2_c3.gif"
width="21" height="150" border="0" alt=""></td>
<td><img name="test_r2_c 4" src="images/test_r2_c4.gif" width="75"
height="31" border="0" usemap="#m_test _r2_c4" alt=""></td>
<td rowspan="2"><im g name="test_r2_c 5" src="images/test_r2_c5.gif"
width="17" height="150" border="0" alt=""></td>
</tr>
<tr>
<td><img name="test_r3_c 2" src="images/test_r3_c2.gif" width="75"
height="119" border="0" alt=""></td>
<td><img name="test_r3_c 4" src="images/test_r3_c4.gif" width="75"
height="119" border="0" alt=""></td>
</tr>
<map name="m_test_r2 _c2">
<area shape="rect" coords="18,9,53 ,22" href="#" title="" alt=""
onMouseOut="MM_ swapImage('test _r2_c2','','ima ges/test_r2_c2.gif' ,1);"
onMouseOver="MM _swapImage('tes t_r2_c2','','im ages/test_r2_c2_f2.g if',1);" >
</map>
<map name="m_test_r2 _c4">
<area shape="rect" coords="18,10,5 4,22" href="#" title="" alt=""
onMouseOut="MM_ swapImage('test _r2_c4','','ima ges/test_r2_c4.gif' ,1);"
onMouseOver="MM _swapImage('tes t_r2_c4','','im ages/test_r2_c4_f2.g if',1);" >
</map>
</table>
</body>
</html>

rollover2.htm (no image map):
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">

<html>
<head>
<title>Untitled </title>
</head>

<body>
<script language="JavaS cript">
<!-- hide
function MM_findObj(n, d) { //v4.01
var p,i,x; if(!d) d=document;
if((p=n.indexOf ("?"))>0&&paren t.frames.length ) {
d=parent.frames[n.substring(p+1 )].document; n=n.substring(0 ,p);}
if(!(x=d[n])&&d.all) x=d.all[n]; for (i=0;!x&&i<d.fo rms.length;i++)
x=d.forms[i][n];
for(i=0;!x&&d.l ayers&&i<d.laye rs.length;i++)
x=MM_findObj(n, d.layers[i].document);
if(!x && d.getElementByI d) x=d.getElementB yId(n); return x;
}

function MM_swapImage() { //v3.0
var i,j=0,x,a=MM_sw apImage.argumen ts; document.MM_sr= new Array;
for(i=0;i<(a.le ngth-2);i+=3)
if ((x=MM_findObj( a[i]))!=null){docum ent.MM_sr[j++]=x; if(!x.oSrc)
x.oSrc=x.src; x.src=a[i+2];}
}
function MM_swapImgResto re() { //v3.0
var i,x,a=document. MM_sr; for(i=0;a&&i<a. length&&(x=a[i])&&x.oSrc;i++ )
x.src=x.oSrc;
}

if (document.image s) {
test2_r2_c2_f2 = new Image(75 ,31); test2_r2_c2_f2. src =
"images/test2_r2_c2_f2. gif";
test2_r2_c2_f1 = new Image(75 ,31); test2_r2_c2_f1. src =
"images/test2_r2_c2.gif ";
test2_r2_c4_f2 = new Image(75 ,31); test2_r2_c4_f2. src =
"images/test2_r2_c4_f2. gif";
test2_r2_c4_f1 = new Image(75 ,31); test2_r2_c4_f1. src =
"images/test2_r2_c4.gif ";
}
// stop hiding -->
</script>

<table border="0" cellpadding="0" cellspacing="0" width="200">
<tr>
<td colspan="5"><im g name="test2_r1_ c1" src="images/test2_r1_c1.gif "
width="200" height="50" border="0" alt=""></td>
</tr>
<tr>
<td rowspan="2"><im g name="test2_r2_ c1" src="images/test2_r2_c1.gif "
width="12" height="150" border="0" alt=""></td>
<td><a href="#" onMouseOut="MM_ swapImgRestore( );"
onMouseOver="MM _swapImage('tes t2_r2_c2','','i mages/test2_r2_c2_f2. gif',1);">
<img name="test2_r2_ c2" src="images/test2_r2_c2.gif " width="75" height="31"
border="0" alt=""></a></td>
<td rowspan="2"><im g name="test2_r2_ c3" src="images/test2_r2_c3.gif "
width="21" height="150" border="0" alt=""></td>
<td><a href="#" onMouseOut="MM_ swapImgRestore( );"
onMouseOver="MM _swapImage('tes t2_r2_c4','','i mages/test2_r2_c4_f2. gif',1);">
<img name="test2_r2_ c4" src="images/test2_r2_c4.gif " width="75" height="31"
border="0" alt=""></a></td>
<td rowspan="2"><im g name="test2_r2_ c5" src="images/test2_r2_c5.gif "
width="17" height="150" border="0" alt=""></td>
</tr>
<tr>
<td><img name="test2_r3_ c2" src="images/test2_r3_c2.gif " width="75"
height="119" border="0" alt=""></td>
<td><img name="test2_r3_ c4" src="images/test2_r3_c4.gif " width="75"
height="119" border="0" alt=""></td>
</tr>
</table>

</body>
</html>
TIA

Dave

Jul 23 '05 #3
JRS: In article <Ux************ ****@newsread2. news.atl.earthl ink.net>,
seen in news:comp.lang. javascript, Jeff Thies <no****@nospam. net> posted
at Thu, 10 Jun 2004 13:41:08 :
Lines: 323
Try to provide the simplest example that demonstrates the problem. Who
wants to go through all that?
Not I.
<snip Dreamweaver crap) ... Where are the images and where is the page? Could that be your "problem"?

Jeff


So why did you then quote all the rest of it?

--
© John Stockton, Surrey, UK. ?@merlyn.demon. co.uk Turnpike v4.00 MIME ©
Web <URL:http://www.uwasa.fi/~ts/http/tsfaq.html> -> Timo Salmi: Usenet Q&A.
Web <URL:http://www.merlyn.demo n.co.uk/news-use.htm> : about usage of News.
No Encoding. Quotes before replies. Snip well. Write clearly. Don't Mail News.
Jul 23 '05 #4

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

22
3068
by: Fabian | last post by:
var preload1 = new Image(); preload1.src = "/pic/yay.gif"; var preload2 = new Image(); preload2.src = "/pic/nay.gif"; The above is meant to preload image files, yes? Problem is, it doesnt seem to be doing so in practice. Any idea where Im going wrong? Could it be that things work differnetly when in an attached .js file? -- --
2
1495
by: Frances Del Rio | last post by:
Hi, I while back I was having a problem with rollovers, even though I do them in a very conventional way: function roll(i) { document.src = eval(i + "_roll.src") } // in which value passed to function is "name" attr in img tag.. but on my home page, www.francesdelrio.com, I have rollovers like this: function doRoll(Img,newImage) {
2
1870
by: Julie | last post by:
Hi, I'm trying to change images on a website without reloading the whole page and use the following code to preload the images: var preloadFlag = false; function preloadImages() { if (document.images) { pic_moon2_click = newImage("images/moonpic2.jpg"); pic_moon3_click = newImage("images/moonpic3.jpg");
6
1566
by: michaaal | last post by:
Is this the correct way to preload an image...? Var Image1 = new Image() ....And then when I'm ready to use the image I can do this...? Button1.src=Image1.src ....Or am I just telling Button1 to use the same source path as Image1?
2
1832
by: windandwaves | last post by:
Hi Gurus Preloading images has got to be JS 101. However, it does not seem to be working. Here is the function that I am using. I added the alerts to make sure it is working and all the right alerts show up, yet when I do my mouseover, it still takes about a second (only the first time) to load the image (thumbnail). Am I missing...
40
2784
by: Geoff Cox | last post by:
Hello, I am still having problems - apologies if the answer is in previous postings! I now have, in the header, <sctipt> var myimages=new Array();
2
2972
by: sachaburnett | last post by:
Hi everyone! I'm new to Javascript and am finding so much useful information on this group, so thanks to you all! I have a question about preloading images for onmouseover/out effects and found so many different ways to do it on the Net but am not sure about something. Right now I have the following code inside my <head> tag:
7
2430
by: Inny | last post by:
Hello again, Im using the code below in a child page (popup), the images are called from the parent page. When the changer is running, the child page goes white between images. I realise this is happening because the Images are not cached (yet) on the users browser. I tried preloading images with the 2nd code below in the childpage head and in...
7
1977
by: Keith Hughitt | last post by:
Hi all, I am having trouble preloading images in a javascript application, and was wondering if anyone had any suggestions. Basically I have a bunch of images stored in a database as BLOBs. At any given point in time a subset of those images is displayed on- screen. At certains times I want to swap out those on screen with new ones from...
0
7401
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language...
0
7656
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. ...
0
7808
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that...
1
7423
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For...
0
7757
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the...
0
3450
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in...
0
3443
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
1884
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system
1
1014
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.