PDA

View Full Version : Popupmenu.js - click for all sub layers & change color for each layer



paankadu
04-13-2010, 02:39 PM
1) Script Title: Popupmenu.js

2) Script URL (on DD): http://dynamicdrive.com/dynamicindex1/popupmenu.htm

3) Describe problem: How do I go about getting it to open the next level of the menu by clicking - I got the first level to go to click to open the 2nd level but can't seem to get it to work right to click to go to the 3rd or 4th level. Also, would like it to show different colors as they roll over the link and enlarge the font. I would also like each sub level be a different color from the parent level - it gets confusing when there are 3 levels and they start overlapping each other and they are all the same color. I believe the font change is in the popupmenu.css file.

Thanks in advance for your assistance
Angie

ddadmin
04-14-2010, 09:12 AM
I assume you want everything to be toggled onClick, including the main menu that's displayed when the anchor link itself is clicked on? Try the attached .js file which does this. If you want the main menu to still be shown onMouseover, change the part in red below to "mouseenter" instead:


$target.bind("click", function(e){


Also, would like it to show different colors as they roll over the link and enlarge the font.

Inside the .css file, you might add the code in red below to get the font of the currently active menu link to change color/size:


.jqpopupmenu li a:hover, .jqpopupmenu li.selected>a{
background: #e0e0e0;
font-size: 16px;
color: red;
}