View Full Version : How to do: "sideways" sub menu when hovering over nav menu images?

03-09-2012, 08:10 PM
Hi there,

I am trying to create "sideways" sub menus off of my main vertical menu images.
(Something like this example: http://netweblogic.com/demos/ddm/vddm-nomoo.htm
but in the place of Menu Item 1, Menu Item 2, Menu Item 3 there would be roll over images.)

The main vertical menu items I have are rollover images.
I would like the sub menu to appear when you hover over the main menu item.

When I attempt this using the above example, all of my other CSS and JS does not work.

Any help on how to link my rollover menu images to the sub menu would be greatly appreciated! Thanks in advance!

Here is the code for my menu (I have only included 2 menu items here, if you need more info please let me know):

<script 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];}

<body onload="MM_preloadImages('images/buttons/teamandcorpsports.jpg','images/buttons/performancesports.jpg','images/buttons/flagsandbanners.jpg','images/buttons/home.jpg','images/buttons/catalogues.jpg','images/buttons/galleries.jpg','images/buttons/designown.jpg','images/buttons/dealerlogin.jpg','images/buttons/contactus.jpg','images/buttons/dealersignup.jpg')">

<div id="wrapper">
<div id="header">

<!-- Main content -->
<div id="content">
<div style="text-align:center">
<img id="pic" src="images/slideshow/slideshow1.jpg" width="600" height="600" alt="slideshow" />

<script type="text/javascript" src="slideshow.js"></script>

<!-- Site navigation menu -->
<div id="navcontainer">
<li><a href="index.html" onmouseout="MM_swapImgRestore()" onmouseover="MM_swapImage('teamandcorpsports1','','images/buttons/teamandcorpsports.jpg',1)"><img src="images/buttons/teamandcorpsports1.jpg" alt="Team and Corporate Sports" name="teamandcorpsports1" width="224" height="37" border="0" id="teamandcorpsports1" /></a></li>

<li><a href="index.html" onmouseout="MM_swapImgRestore()" onmouseover="MM_swapImage('performancesports1','','images/buttons/performancesports.jpg',1)"><img src="images/buttons/performancesports1.jpg" alt="Performance Sports" name="performancesports1" width="224" height="37" border="0" id="performancesports1" /></a></li>

Here is my CSS code for the menu, not sure if this is where the issue is?

/* navigation menu */
#navcontainer ul {
margin: 0;
padding: 0;
list-style-type: none; /* removes bullets */

#navcontainer li {
margin: 0 0 0 0; /* separates list items */

#navcontainer a
display: block; /* achieves rollover */

width: 250px; /* list width */

text-decoration: none;