JQuery :: Collapsible Vertical Menu - How To Target Next Element
Sep 12, 2011
I have a following menu that I'd like to be collapsible.
<ul id="#menu-sidebar">
<li>Menu item 1
<ul><li>Menu item 1.1</li>
<ul></li>
<li>Menu item 2
<ul><li>Menu item 2.1</li>
</ul></li></ul>
This collapses and expands them, but of course all at same time.
$('#menu-sidebarli ul').hide();
$("#menu-sidebarli").click(function(){
$("#menu-sidebarli").toggle();
$(this).toggleClass("active");
});
I've been trying to experiment with the .next() trying to get the next ul li ul element but with little luck.
$('#menu-sidebar li ul').hide();
$("#menu-sidebar li").click(function(){
$("#menu-sidebar ul li").next().toggle();
$(this).toggleClass("active");
I'm looking to implement a Collapsible vertical navigation script into my site - i'v searched the forums and other various sites and found scripts that where close to what i wanted to achieve but missing various elements.
I'v attached an image to this post to show you what I had in mind and hopefully someone can help me (hopefully using css and as little javascript as poss - or perhaps using DOM?)
provide me with code to make a collapsible menu? What I'm looking for is a vertical menu, that will open up the sub-categories upon a mouseover. Clicking on the menu item will bring them to the specific page. Oh, and this might not matter, but I'd prefer if I was able to style the menu to fit with my site theme.
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.
The problem is that the height of the second level menu results in their being gaps in between each menu item so that as you move your mouse down the second menu items it quickly closes again. scripting novice fix this by telling me which variable I need to change either in the Java script or the CSS files.
Second Question: For some reason, the menu is appearing behind a table row when it expands, thus hiding a good portion of the menu. Here it is: [URL]
Try clicking on 'Products & Services', and then clicking on "Centerfire Rifle Suppressors" from the dropdown menu. When it takes you to that category page, click the menu again and you will see that the menu hides behind the <h1> table row.
It's basically a vertical list of links, with more specific links hidden inside categories. When you click a category, the specific links should slide down. This is the JS/jQuery part:
Code:
<script type="text/javascript"> function slidey() { $("#vnav ul li ul").slideDown("slow");
[code]....
so the problem here is that when you click a category, it expands ALL sub-categories and it's supposed to just expand the sub-categories related to the section clicked.
I'm using the Superfish vertical menu to develop an online book. My vertical menu which consists of chapters and sections place on the side of my page, and is long enough to show all of the main items. However, as the chapters get lower in the page, the submenu items (my section names) get cutoff (there's not enough room to show all subitems for the final 2 chapters). So, I guess I have 2 questions:
1) Is there some sort of option to tell Superfish to realize "Hey, not enough room for the menu, so I need to move the submenu up higher" and if not
2) Could someone give me some direction as to how I might be able to move "up" a few of my submenus by diving into the code? In other words, instead of the first item in my submenu visually matching up with the main option, have the 3rd or 4th visually matchup, thereby giving me the extra space needed when close to the bottom of the page.
Can any one recommend a vertical menu plugin that could be used in a sidebar. I've used Superfish, but I don't care for fly-outs and would prefer a collapsable version that drops straight down on click or mouse over.
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.
I am using both horizontal and vertical tab menu's in a single page. And on click of horizontal tab should select the corresponding vertical tab and along with the data linked to vertical data will be displayed in different div on the page. I am stuck with how to poputale these using jquery.
I'm developing a site where the client needs a drop down nav <ul> menu. I'm using jquery to do this and it all works just fine except for the actual href aspect. The drop menu animation is functioning perfectly, but when the actual links are clicked on, the target url doesn't load. Just trying to get the links to function.
Here's the test url. The only two pages I have live are index.php and scp.php so we'll have to conduct our test by clicking back and forth between those.
[URL]
The code from my jquery config script file is below:
// drop down menu functionality $(document).ready(function(){ $( '#menu > li > ul' ) .hide()
Is there anyway to make a vertical super fish menu drop left? I have positioned the menu on the right side of the page so, I need sub-menus to drop left. Is this possible?
Love this menu. This menu will be appearing in module on right hand side of page. So I need the submenu to display on left, not right. So how to make this a right to left menu? I've played around a bit and have had no luck yet. I've used the navbar on another site and I'd really like to use this vertical menu too.
I am trying to work out a vertical multilevel sliding menu. I started using the UI accordion but I just discovered this code in an old post that works fine:
I would have wished it under better circumstances. However, I'm having a quite annoying problem. I'm using jQuery UI hide effect and for some reason it messes with the DOM and/or and completely messes up some of my controls.$('#dvucCustomization').hide('fold', {}, 500);Is that the correct way to call the hide effect on a DIV element?I also tried simply:$('#dvucCustomization').hide('fold');and the same result: the JSs I have in the hidden/shown element are not working any more.
Does anyone know of a good option [using JQuery of course] that will add a vertical scroll bar to an HTMl form? I need to have some static position stay in my top div and only have the form be scrollable. In my search I only came across horizontal scrolls.
I'm binding a click event to a div so that I can see whether is was the div or some element inside the div that has been clicked. When the if() in my code evaluates to true $(this) is still equal to $("#content") whereas I'd like to have the clicked anchor as matched element. How would I do this?
I would like to use the menu that is linked below. I implemented it on my website but I discovered that it can only go 2 levels deep. I would like it to go one more level and I think that would be done in the javascript but I can't tell for sure. Could someone steer me in the right direction? [URL]
I am a newbie to Sitepoint, and relatively new to CSS and JS. I am using a script from Dynamic Drive and have posted this on their forum as well, with no luck. The menu looks great in every browser but IE. When you hover over the parent page and the child pages show up, they go away when you start to scroll down. But if you scroll really slow, they stay up. I am trying to avoid re-doing the whole thing. Both the CSS and the HTML are below. The site is computerdepot-online.net
I've been working on a vertical reveal menu. Right now it works ok with CSS. But what i'd like it to do is when you mouse over, reveal the menu and have that menu stay open until the user mouses over another menu item. Right now it's a bit jumpier than i'd like it and would like to basically have it stay open on a mouse out event, again until it hits another menu item. Code:
I'm currently trying to build a vertical mega menu as all the ones on the net seem to be set up for horizontal menus. I'm struggling a bit on a certian point as I'm not a very strong Javascript user.It places the mega menu under the button but i want it to appear to the side of the button and be flush with the top of it. I have made it appear to the side but I cant seem to make it run flush with the top of the button, it appears at the bottom of the button.The buttons are 142px wide and 28 in height.
If you look at this test page (http:[url]....), you see a vertical image menu. This menu is originally from http:[url]....But... how can you get it to 100% heigh?