New Help with Javascript Navigation

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Hello,

I would really appreciate some help.

I would like to use a simple javascript menu with rollovers for my left side navigation with 3 stages: up, mouse over, and down.

The images and the rollover images work fine, but when I click on them, the links don't work. I am trying to figure out the correct code I need to use for each image. The down part doesn't work either but I will try to figure it out after I fix the links.

if you look at my site:
http://216.174.99.9/~mystore/home.php

on the left side bottom navigation, where I say txt subcategories
it uses the code bellow which works fine:

<tr>
<td>	
{section name=cat_num loop=$subcategories}
<A href="home.php?cat={$subcategories[cat_num].categoryid}"> {$subcategories[cat_num].category}</A><BR>
{/section}
</td>
</tr>

I am now trying to apply the same code to the top part navigation where I use images instead of text. Right now the images and rollovers work fine, but the links all go to the same (home) page???

My rollover images code code:
{literal}
<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[i])&&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[i].indexOf("#")!=0){ d.MM_p[j]=new Image; d.MM_p[j++].src=a [i];}}
}

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[i][n]; for(i=0;!x&&d.layers&&i<d.layers.length;i++) x=MM_findObj (n,d.layers[i].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[i]))!=null){document.MM_sr[j++]=x; if(! x.oSrc) x.oSrc=x.src; x.src=a[i+2];}
}
//-->
</script>
{/literal}	
<body onLoad="MM_preloadImages('../images/leftnav/ navleft_over1.gif')"><table width="150" border="0" cellspacing="0" cellpadding="0">
        <tr>
          <td height="8">image categories </td>
        </tr>
        <tr><td height="8"></td></tr>
        <!-- categories -->
<tr><td><a href="home.php?cat={$categories[cat_num].categoryid}" onMouseOut="MM_swapImgRestore()" onMouseOver="MM_swapImage ('Image15','','{$ImagesDir}/leftnav/navleft_over1.gif',1)"> <img src="{$ImagesDir}/leftnav/navleft1.gif" name="Image15" width="150" height="17" border="0"></a></td></tr> <tr><td><a href="home.php?cat={$categories[cat_num].categoryid}" onMouseOut="MM_swapImgRestore()" onMouseOver="MM_swapImage ('Image16','','{$ImagesDir}/leftnav/navleft_over2.gif',1)"> <img src="{$ImagesDir}/leftnav/navleft2.gif" name="Image16" width="150" height="17" border="0"></a></td></tr> <tr><td><a href="home.php?cat={$categories[cat_num].categoryid}" onMouseOut="MM_swapImgRestore()" onMouseOver="MM_swapImage ('Image17','','{$ImagesDir}/leftnav/navleft_over3.gif',1)"> <img src="{$ImagesDir}/leftnav/navleft3.gif" name="Image17" width="150" height="17" border="0"></a></td></tr>

<tr><td height="15"><img src="../images/leftnav/pix_150_15.gif" width="150" height="15"></td></tr>
		
		
		
		<tr><td height="15">
	
		
		 <!-- subcategories -->
<table width="150" border="0" cellspacing="0" cellpadding="0">

<tr><td><a href="home.php?cat={$subcategories[cat_num].categoryid}" onMouseOut="MM_swapImgRestore()" onMouseOver="MM_swapImage ('Image22','','{$ImagesDir}/leftnav/subnavleft_shop12th_over1.gif', 1)"> <img src="{$ImagesDir}/leftnav/subnavleft_shop12th1.gif" name="Image22" width="150" height="17" border="0"></a></td></tr> <tr><td><a href="home.php?cat={$subcategories[cat_num].categoryid}" onMouseOut="MM_swapImgRestore()" onMouseOver="MM_swapImage ('Image24','','{$ImagesDir}/leftnav/subnavleft_shop12th_over2.gif', 1)"> <img src="{$ImagesDir}/leftnav/subnavleft_shop12th2.gif" name="Image24" width="150" height="17" border="0"></a></td></tr> <tr><td><a href="home.php?cat={$subcategories[cat_num].categoryid}" onMouseOut="MM_swapImgRestore()" onMouseOver="MM_swapImage ('Image25','','{$ImagesDir}/leftnav/subnavleft_shop12th_over3.gif', 1)"> <img src="{$ImagesDir}/leftnav/subnavleft_shop12th3.gif" name="Image25" width="150" height="17" border="0"></a></td></tr> <tr><td><a href="home.php?cat={$subcategories[cat_num].categoryid}" onMouseOut="MM_swapImgRestore()" onMouseOver="MM_swapImage ('Image26','','{$ImagesDir}/leftnav/subnavleft_shop12th_over4.gif', 1)"> <img src="{$ImagesDir}/leftnav/subnavleft_shop12th4.gif" name="Image26" width="150" height="17" border="0"></a></td></tr> <tr><td><a href="home.php?cat={$subcategories[cat_num].categoryid}" onMouseOut="MM_swapImgRestore()" onMouseOver="MM_swapImage ('Image27','','{$ImagesDir}/leftnav/subnavleft_shop12th_over5.gif', 1)"> <img src="{$ImagesDir}/leftnav/subnavleft_shop12th5.gif" name="Image27" width="150" height="17" border="0"></a></td></tr> <tr><td><a href="home.php?cat={$subcategories[cat_num].categoryid}" onMouseOut="MM_swapImgRestore()" onMouseOver="MM_swapImage ('Image28','','{$ImagesDir}/leftnav/subnavleft_shop12th_over6.gif', 1)"> <img src="{$ImagesDir}/leftnav/subnavleft_shop12th6.gif" name="Image28" width="150" height="17" border="0"></a></td></tr> <tr><td><a href="home.php?cat={$subcategories[cat_num].categoryid}" onMouseOut="MM_swapImgRestore()" onMouseOver="MM_swapImage ('Image29','','{$ImagesDir}/leftnav/subnavleft_shop12th_over7.gif', 1)"> <img src="{$ImagesDir}/leftnav/subnavleft_shop12th7.gif" name="Image29" width="150" height="17" border="0"></a></td></tr> <tr><td><a href="home.php?cat={$subcategories[cat_num].categoryid}" onMouseOut="MM_swapImgRestore()" onMouseOver="MM_swapImage ('Image30','','{$ImagesDir}/leftnav/subnavleft_shop12th_over8.gif', 1)"> <img src="{$ImagesDir}/leftnav/subnavleft_shop12th8.gif" name="Image30" width="150" height="17" border="0"></a></td></tr> <tr><td><a href="home.php?cat={$subcategories[cat_num].categoryid}" onMouseOut="MM_swapImgRestore()" onMouseOver="MM_swapImage ('Image30','','{$ImagesDir}/leftnav/subnavleft_shop12th_over8.gif', 1)"> <img src="{$ImagesDir}/leftnav/subnavleft_shop12th8.gif" name="Image30" width="150" height="17" border="0"></a></td></tr> <tr><td><a href="home.php?cat={$subcategories[cat_num].categoryid}" onMouseOut="MM_swapImgRestore()" onMouseOver="MM_swapImage ('Image30','','{$ImagesDir}/leftnav/subnavleft_shop12th_over8.gif', 1)"> <img src="{$ImagesDir}/leftnav/subnavleft_shop12th8.gif" name="Image30" width="150" height="17" border="0"></a></td></tr> <tr><td><a href="home.php?cat={$subcategories[cat_num].categoryid}" onMouseOut="MM_swapImgRestore()" onMouseOver="MM_swapImage ('Image30','','{$ImagesDir}/leftnav/subnavleft_shop12th_over8.gif', 1)"> <img src="{$ImagesDir}/leftnav/subnavleft_shop12th8.gif" name="Image30" width="150" height="17" border="0"></a></td></tr> <tr><td><a href="home.php?cat={$subcategories[cat_num].categoryid}" onMouseOut="MM_swapImgRestore()" onMouseOver="MM_swapImage ('Image30','','{$ImagesDir}/leftnav/subnavleft_shop12th_over8.gif', 1)"> <img src="{$ImagesDir}/leftnav/subnavleft_shop12th8.gif" name="Image30" width="150" height="17" border="0"></a></td></tr>

</table>
	
    </td>
  </tr>
</table>
</BODY>
</HTML>

Thank you.

--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php


[Index of Archives]     [PHP Home]     [Apache Users]     [PHP on Windows]     [Kernel Newbies]     [PHP Install]     [PHP Classes]     [Pear]     [Postgresql]     [Postgresql PHP]     [PHP on Windows]     [PHP Database Programming]     [PHP SOAP]

  Powered by Linux