Jump to content
  • Checkout
  • Login
  • Get in touch

osCommerce

The e-commerce.

Roll-over graphics not active


lomoland

Recommended Posts

Calling all,

 

I have set up a table within my header which contains navigation elements. However, the roll-over graphics which I included in the table do not change when viewed through my browser. Can anyone figure out why this might be? Heres the code:

 

<td align="left" valign="top"><a onmouseover="changeImages( /*CMP*/'About',/*URL*/'images/nav_about_over.gif');return true" onmouseout="changeImages( /*CMP*/'About',/*URL*/'images/nav_about.gif');return true" href="#"><img src="images/nav_about.gif" alt="About Us" name="About" height="24" width="64" border="0"></a></td>

 

 

Thanks in advance,

Al.

Link to comment
Share on other sites

Hi,

I had a similar prob, I found some code posted by I think, [email protected], I'm sorry I can't find the original thread, so I've pasted the section out of my header.php which I was able to get working.

 

Hope it helps

Cheers

 

 

<script language="JavaScript" type="text/JavaScript">

function MM_swapImgRestore() { //v3.0

var i,x,a=document.MM_sr; for(i=0;a&&i<a.length&&(x=a)&&x.oSrc;i++) x.src=x.oSrc;

}

 

function MM_preloadImages() { //v3.0

var d=document; if(d.images){ if(!d.MM_p) d.MM_p=new Array();

var i,j=d.MM_p.length,a=MM_preloadImages.arguments; for(i=0; i<a.length; i++)

if (a.indexOf("#")!=0){ d.MM_p[j]=new Image; d.MM_p[j++].src=a;}}

}

 

function MM_findObj(n, d) { //v4.01

var p,i,x; if(!d) d=document; if((p=n.indexOf("?"))>0&&parent.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.forms.length;i++) x=d.forms[n];

for(i=0;!x&&d.layers&&i<d.layers.length;i++) x=MM_findObj(n,d.layers.document);

if(!x && d.getElementById) x=d.getElementById(n); return x;

}

 

function MM_swapImage() { //v3.0

var i,j=0,x,a=MM_swapImage.arguments; document.MM_sr=new Array; for(i=0;i<(a.length-2);i+=3)

if ((x=MM_findObj(a))!=null){document.MM_sr[j++]=x; if(!x.oSrc) x.oSrc=x.src; x.src=a[i+2];}

}

//-->

</script>

<table border="0" width="100%" cellspacing="0" cellpadding="0" bgcolor="#ffffff">

<tr class="headerNavigation">

<td><a href="http://www.xxxxx.com" onMouseOut="MM_swapImgRestore()" onMouseOver="MM_swapImage('Image4','','images/header/nav_home_a.gif',4)"><img src="images/header/nav_home_b.gif" name="Image4" border="0" alt="Return to HOME page"></a><a href="<?php echo tep_href_link(FILENAME_DEFAULT, '', 'NONSSL'); ?>" onMouseOut="MM_swapImgRestore()" onMouseOver="MM_swapImage('Image5','','images/header/nav_shopfront_a.gif',5)"><img src="images/header/nav_shopfront_b.gif" name="Image5" border="0" alt="Shopfront"></a></td>

<td align="right" ><?php if (tep_session_is_registered('customer_id')) { ?><a href="<?php echo tep_href_link(FILENAME_LOGOFF, '', 'SSL'); ?>" onMouseOut="MM_swapImgRestore()" onMouseOver="MM_swapImage('Image6','','images/header/nav_logoff_a.gif',6)"><img src="images/header/nav_logoff_b.gif" name="Image6" border="0" alt="Logoff"></a><?php } ?><a href="<?php echo tep_href_link(FILENAME_ACCOUNT, '', 'SSL'); ?>" onMouseOut="MM_swapImgRestore()" onMouseOver="MM_swapImage('Image1','','images/header/nav_account_a.gif',1)"><img src="images/header/nav_account_b.gif" name="Image1" border="0" alt="Account"></a><a href="<?php echo tep_href_link(FILENAME_SHOPPING_CART, '', 'SSL'); ?>" onMouseOut="MM_swapImgRestore()" onMouseOver="MM_swapImage('Image2','','images/header/nav_viewcart_a.gif',2)"><img src="images/header/nav_viewcart_b.gif" name="Image2" border="0" alt="View Cart"></a><a href="<?php echo tep_href_link(FILENAME_CHECKOUT_SHIPPING, '', 'SSL'); ?>" onMouseOut="MM_swapImgRestore()" onMouseOver="MM_swapImage('Image3','','images/header/nav_checkout_a.gif',1)"><img src="images/header/nav_checkout_b.gif" name="Image3" border="0" alt="Checkout"></a></td>

</tr>

</table>

Link to comment
Share on other sites

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...