Submenu Stay Open On Menu Click Isn't Working Correct

Nov 22, 2011

I have a menu with some items containing a submenu. The submenu's should open when a parent is clicked and contains submenu's, and when traveling to another page (from the item clicked, for example a parent of submenu item), the submenu should remain active and visible.

When I click on a parent (at the moment the hrefs contain no links just #), the submenu opens. But when I click another main item, the submenu of the previous parent remain visible, and the submenu of the parent just clicked is also visible, while I only want the submenu of the parent clicked to be visible or when parent with no submenu the submenu should be invisible.

So, here is the code I have so far:

Code:

The javascript:

Code:

And the css:

Code:

View 4 Replies


ADVERTISEMENT

JQuery :: Horizontal Submenu Will Not Stay Open On Menu Click?

Nov 16, 2011

I have a horizontal menu with some subitems. At the moment when I click on the main menu the submenu is being shown and it remains open even if I click anywhere on the page. But here is the tricky part, when I click on a menu item (in the submenu) I want the submenu to display the items on which the page is.For example the menu looks like this:home

page1
page1a
page1b

[code]....

View 14 Replies View Related

Submenu Staying Open On Menu Click?

Nov 22, 2011

I have a menu with some items containing a submenu. The submenu's should open when a parent is clicked and contains submenu's, and when traveling to another page (from the item clicked, for example a parent of submenu item), the submenu should remain active and visible. When I click on a parent (at the moment the hrefs contain no links just #), the submenu opens. But when I click another main item, the submenu of the previous parent remain visible, and the submenu of the parent just clicked is also visible, while I only want the submenu of the parent clicked to be visible or when parent with no submenu the submenu should be invisible.

So, here is the code I have so far:
Code:
<div id="topnav">
<ul>
<li>
<a href="index.html">Home</a>
[Code]....

View 4 Replies View Related

Get Accordion Menu To Stay Open?

Jun 14, 2011

I mainly do PHP/MySQL coding, but I wanted to add this Javascript Accordion Menu to my site:

Javascript And CSS Tutorial - Accordion Menus | Switch on the Code [URL]

It works fine, but I was wondering if there was a simple way to modify the code so that the currently open menu stays open from page to page instead of closing upon each page reload?

View 7 Replies View Related

Expandable Menu Won't Stay Open?

Feb 2, 2009

i'm using php include for the left product menu at [URL]

however, when a specific category is clicked on, i would like the menu to stay expand when the page loads.

View 1 Replies View Related

JQuery :: If Statement - When Click A Different Button To Open A Different Box - The "div#black" Should Stay Open And Not Toggle

Oct 17, 2010

Clicking on the menu buttons, a box with some info opens, ad under that, a div that makes the body of the site black. the problem is when i click a different button, to open a different box, the "div#black" should stay open and not toggle. i tried this

var black = $("div#black").toggle() ;
if (black == false { $("div#black).fadeIn("slow"); };

and this was the javascript for the button (with the toggle function, when i didn't use the if/else):

[Code]....

I don't know which is the correct way to write the if statement, i used easier ones but this one is to complex for me :D i think the main problem is the "var"

View 4 Replies View Related

JQuery :: Trying To Create Dropdown Menu - Stay Open While Hovered?

May 26, 2010

I know this is simple and has been done before. I'm trying to create a dropdown menu for secondary links. I want it to appear when you hover over a primary link. I can't do a simple .hover function with two handlers because once the user moves the mouse to go into the secondary menu, it will slide back away.

The easy solution is to put that secondary menu within the selector of the primary menu - but it's not possible with my setup.

View 2 Replies View Related

JQuery :: Make Menu Link Open Submenu And Go To Href Location

Dec 2, 2010

I have inherited some code that changes the behavior or menu links with submenus to open the submenu but I need it to both open the submenu and go to the link location.

Here is the code:
$('#leftNav #menu li a').click(
function() {
$('#leftNav #menu li a').removeClass('selectedAccordion');
$(this).addClass('selectedAccordion');
$('#leftNav #menu ul.currentnav li a').removeClass('selectedAccordion');
$('#leftNav #menu li ul li a').removeClass('selectedAccordion');
//$(this).parent('li').addClass('selectedAccordion');
var checkElement = $(this).next(); if((checkElement.is('ul')) && (checkElement.is(':visible'))){
return false;
}
if((checkElement.is('ul')) && (!checkElement.is(':visible'))) {
if(checkElement.parent().parent().parent().is(':visible')) {
checkElement.slideDown('normal');
return false;
}
$('#leftNav #menu ul:visible').slideUp('normal');
checkElement.slideDown('normal');
return false;
}}

How do I put back the behavior to open the submenu AND go to the link location? I found I could add location.href = $(this).attr('href'); and go to the correct, but then the submenus slideUp and are hidden again. I can't figure out why changing the page closes the menus.

View 1 Replies View Related

Expanding Menu To Stay Expanded When Click A Link To Go To Another Page While Navigating?

Jun 29, 2010

I am doing an internship at a company and am working on an existing site. The Company wants the expanding menu to stay expanded when you click a link to go to another page while navigating. I am very new to Javascript, CSS, and html and could really use some insight or code example.

// JavaScript Document
/* This script and many more are available free online at
The JavaScript Source :: http://javascript.internet.com

[code]....

View 1 Replies View Related

JQuery :: Collapsible Menu Not Working Correct In Internet Explore 8

Jul 29, 2010

I have writen(as you can see i am not a jQuery expert :P ) a small piece of code for a ul/li collapsible menu, all browsers do what i want but IE8 is not working propper.

jQuery("a.cat_w_sub").toggle(function(){
if (jQuery(this).next("ul").is(":hidden")) {
jQuery(this).next("ul").slideDown(100);
jQuery(this).addClass("cat_open");

[Code].....

I have used the jQuery ui accordion first but this wasn't work that well, so i switch to this piece of code

The bug/error: well if i click on the menu(which is closet at first) it doesn't open at first but once i click on it, it opens and closes.

View 7 Replies View Related

JQuery :: SuperFish Menu - Change Space Between Menu And Submenu In Navi-bar Type Menu?

Feb 15, 2011

I have trouble with SuperFish Menu, of course it looks very nice and is good solution, but I am not advanced in CSS language.how to change space between menu and submenu in Navi-bar type menu? Now sobmenu hide part of menu, I have to must space.....

Attachments
superfis.JPG
Size : 11.4 KB
Download : 306

View 1 Replies View Related

JQuery :: Accordion Style Menu - Previous Sub Menu Disappears - Only One Submenu Can Be Visible At One Time

Sep 1, 2011

I needed a sidebar menu that, when a user clicks the <h3>, a submenu expands. When the user then clicks on a different menu item, the previous submenu disappears meaning only one submenu can be visible at one time.

Now the code I have at the moment (from jQuery forums) works. It now needs a bit more refining so that it works the way I intend.

When you first load the page, all of the submenus are collapsed which is a real pain as each submenu has 20 - 30 selections.

Is there a way to have them all hidden initially?

Is there a way to get an open submenu to close by clicking on the H3 title again?

Since the site is local only, I posted up a sample on my JSfiddle account.

[url]

This one, which I also found on google, did what I wanted, but without the smooth slide animation. - [url]

When you then click on one of the H3's, it kicks into action and works great!

View 2 Replies View Related

Dropdown Submenu - Make A Horizontal Drop Down Menu With A Sub Menu ?

Nov 3, 2009

I actually want to make a horizontal drop down menu with a sub menu.As far as I have researched, I think that it can be done by JavaScript. I have searched for some java scripts but they are very long and complex.

That made me wonder that for a funcitonality like a Drop down is so complex?

So here is my question : Is there any JavaScript that can be applied for drop down menu exclusively? Which just presents logic of drop down solely?

View 3 Replies View Related

Script For Menu - Make The Menu To Stay Even We Use The Scrollbar Of The Browser?

Mar 1, 2011

I want to create a menu like the left (as we see that) menu of getitnow.gr.Do you know any script for this?I use prototype framework,is there any script related with prototype? I mean a script that make the menu to stay even we use the scrollbar of the brownser.

View 1 Replies View Related

JQuery :: Moving Menu Css - Create A Menu With Submenu

Jan 31, 2011

I want create a menu with submenu. I want that when I hover menu item, it goes up and then submenus items appear. It is possible?

Example:

View 1 Replies View Related

Open Drop-down Menu On Mouse Click?

Nov 8, 2011

How to add sub menus that should appear on mouse click and should disappear on mouse click.

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">

[code]....

View 3 Replies View Related

JQuery :: Accordion Stay Open If Mouse Comes From Top

Jun 5, 2011

The accordion-menu I created works nice from the bottom, but if the mouse comes from top it isn't functional. Do you know a trick to let the bullets open if the mouse comes from the top?[code]

View 1 Replies View Related

Making Drop Down Menu With Submenu

Jul 20, 2005

If I select one of the menu items the submenu appears just fine, my only
problem is that If I point the mouse curser away from the whole menu the
submenu is still shown, obviously if I click once with the mouse outside the
menu the submenu disappears. So I need some kind of remove-submenu function
when the mouse pointer is not pointing on menusubmenu....

View 1 Replies View Related

Expandable Menu Display Current Submenu ?

Apr 27, 2009

I have built an expandable menu that displays some categories and subcategories. The menu is populated from a MySQL DB and I'm using PHP to configure the data for the Javascript menu. All of this works correctly.

There are 2 options when using the menu.

1. Click the arrow icon next to the category option. This opens the subcategories for that category while remaining on the current page.

2. Click the category title (text link). This brings you to the category page.

When a user clicks the category title to go to the category page, I want the subcategories for that category to be open when they get there.

Everything seems to be working correctly, until I get to the line to open the subcategory.

View 4 Replies View Related

Get An On Click Changing Background To Stay?

Nov 20, 2010

I used this on-click changeable background code for my website code...

And now I have the same question as the original poster: is there any way to get it so that the chosen background stays put even if the page is refreshed or navigated away from? Or is it not possible because all my pages are separate files? code...

View 12 Replies View Related

Make One Menu Item Stay Active?

Aug 19, 2011

I'm only adding this code to a few pages. I have the background changing over each linked hover, but is there anyway for me to allow one item remain that background color to indicate which page my visitors are currently on. If you can show me how to do one, I can figure out the rest. Code below.

[Code]..

View 2 Replies View Related

JQuery :: Click To Expand Superfish Submenu?

May 2, 2010

I would very much like to be able to click to expand a submenu in Superfish, rather than the default hover to expand. How can I achieve this?

View 2 Replies View Related

JQuery :: Mouseover - Show And Hide Submenu Of Menu DIV

Feb 9, 2011

I'm struggling around to show submenu on mouseover of menu-div. I found a solution to show each children of one menuitem, but I wont to show the whole submenu-strukture of all menuitems. Here is what I've done till now:

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "[URL]">
<html xmlns ="[URL]">
<head>
<meta
http-equiv ="Content-Type"
content ="text/html; charset=utf-8" .....

So when I hover over li.first I will get all submenu-items of the first heading! Is it possible to mouseover the div#navi or the ul#nav to get shown all submenu-items from every menuheading?

I tried something like this, but of course it doesn't workjQuery(document).ready(function(){
jQuery(".first ul").hide();
jQuery(".#nav").hover(function () {
jQuery(this).children(".first ul").toggle("slow");
});
});

View 2 Replies View Related

JQuery :: Superfish: Vertical Menu With Horizontal Submenu?

Nov 16, 2011

I'm wondering how to modifiy the vertical menu of superfish to let the submenu appear horizontal next to the parent menu element:123 3a 3b 3c45I just spent some hours searching on Google andplayed around with the CSSbut could not manage to fix it.

View 1 Replies View Related

Submenu Code - Floating Horizontal Dropdown Menu

Dec 7, 2009

Where do I need to look to find such a script?

Ive been looking for 3 days now and I cant find something that will have all of those.

I need a floating horizontal dropdown menu, and submenu with mouse over description of the site.

EX: menu 1

View 12 Replies View Related

Dropdown Menu Mouseover Where The Button Does Not Stay Hovered

Nov 28, 2011

I've been looking for a solution to a dropdown menu problem where the button does not stay hovered when the list is navigated/as soon as the cursor leaves the button area. At the moment the effect is setup using css sprites (locally) but I have seperate images also for the 2 states.

[Code]...

View 5 Replies View Related







Copyrights 2005-15 www.BigResource.com, All rights reserved