JQuery :: Superfish: Leave Sub <ul> Menu Visible When A Tag Class Is Set As Active
Sep 13, 2009
I'm using superfish for a drop down hover menu. It works perfect except I would like the sub menus to remain visible when one of the <a> tag from the menu has class="active". Here is a quick overview of the menu html:
If the current page is main -- class='active' is automatically added to the A tag (with Drupal). If you are currently in page2, the class='active' is added to the A tag of the sub-menu. Now, how can I get the sub menu to be always displayed -- regardless of superfish, either when item parent 1 A tag is set as class='active'of the item child A tag is set as class='active'.
I'm almost done customizing the Superfish jQuery menu to fit my web site theme. I have all of the menu hover and submenu hover styles in place, but I'm having a problem with the color of the top-level menu item's font when the submenu is expanded. The active top menu item's background matches the hover color, but when I hover overa submenu item, the font color reverts back to the original (non-hovered) color. How do I get the top level menu item's color to match its hover color when the submenu is expanded?
The relevant portions of my CSS are as follows: .sf-menu a, .sf-menu a:visited { /* visited pseudo selector so IE6 applies text colour*/ color:#8C1C39; }.sf-menu a.sfHover { color:#FFFFFF; }.sf-menu li { background:transparent; }.sf-menu li li { background:#FFFFFF; }.sf-menu li li li { background:#9AAEDB; }.sf-menu li:hover, .sf-menu li a:hover { color: #FFFFFF; background:#00207B;outline:0; }.sf-menu a:focus, .sf-menu a:active, .sf-menu li li a:hover, .sf-menu li.sfHover { background:#8C1C39; color: #FFFFFF; outline:0; }
I'm having issues with jquery and the tabs I'm using. My tabs work but... I want some more functions and that seems to be a big problem for a Javascript and jquery newby.
I really don't know if this is correct but it works! What doesn't work is the active class. If you use one of the buttons in the first tab you go to the right tab but the tab itself has no class called active and that ruins the style.
2) I also have one other question: lets say that all the above is my second page and I have my frontpage in which I also have buttons. I want somebody to use the button and end up in the third tab of page 2. My link is something like
Code: page2.html#tab3
I read that using this should lead you the third tab but it's not working for me. You go to the first tab of page 2 instead.
I've been reading a LOT! Jquery for dummies, I googled, read the forum and other forums. I posted on a Dutch forum but no answer. I've added a lot of different code but it doesn't work.
I'm trying to add .active class to a menu, based on the URI. It works with URL's like: /, /products, /about, /contact but not anymore when you go to /products/some-product.I know what's wrong, but I can't find a working solution. I've tried a regex, but that didn't work either...
The code:
$(function() { var path = location.pathname; if (path) {
I have the following code that don't work like i want it.
Code: function hideDisplaySingleSuite(textstring) { var myclass1 = new RegExp('\b'+textstring+'\b'); //Populate the array with all the page tags[code]....
For example.It show objects if I remove the if statement that checks if the class is visible.for example this shows a class and works.
Code: function hideDisplaySingleSuite(textstring) { var myclass1 = new RegExp('\b'+textstring+'\b'); //Populate the array with all the page tags[code]....
So my question is why don't this work on a class, it works on an "id"?
Code: if (allPageTags[i].style.display ==''){ allPageTags[i].style.display = 'none'; }[code]....
I want to show the class if its not visible or hide it if it is visible.How can this be done?
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.....
I'd like to be able to get Superfish to expand the entire menu and show the current active link in pathlevel 2. I'm using the nav-bar style and it seems that only pathlevel 1 is visible:
I am attempting to make a menu that has a background image that changeswhen you rollover or click a menuitem. I've got the hover effect working fine with CSS, but am trying to implement the click event via jquery with the following:
My process is to reset the entire menu to the inactive state, then switch on the active state for the item that was clicked. Eventually, the item that was clicked will display its corresponding body section as well. I've tried using the CSS pseudo-class "active", but since the entire div is the link, that is unavailable. I've also tried multiple variations of addClass/removeClass, toggleClass, and setAttribute/removeAttributebut nothing hasworked so far.
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!
how to make the menu items a fixed width in a horizontal Superfish menu . I've tried mucking about with the CSS but no luck so far. I'm sure it's easy, but I can't seem to work it out.
I'm using superfish menu jquery plugin, and I'm wondering if someone know how to update plugin that you can decide if sub - sub menus wil be shown on the right (that is in the original) or on the left side of the parent menu.
The problem is, that if the last menu is near the end of the browser, than the sub - sub menu will go off side the browser.
adding a class to an active li. I'm working in drupal, and the system adds a .active class to the DOM of whatever li class was last selected.In my .js file I added the following:
$('document').ready(function(){ var tabActive = $('#tabs-tabset ul.primary li.active a'); tabActive.addClass('tabknotch') });
This works perfectly...for the first tab. when I navigate to the next tab the class does not change. I thought maybe there's a variable in the dom that is causing the class to not move, so I tried narrowing the div that it looks for and tried this:
$('document').ready(function(){ var tabActive = $('li.active a'); tabActive.addClass('tabknotch') });
This achieved the exact same results...so there's obviously something I'm missing, but don't know what it is. If it's any help, here are two examples of the generated DOM that occurs when clicking on the active li. The first example is the div that has the class added, and the second is a div that does not have anything added. <li class="overview ui-tabs-selected active first tabknotch"><a href="#overview"><span class="tab">Overview</span></a></li> (this is the active tab where the jQuery succesfully adds the "tabknotch" class)<li class="features ui-tabs-selected active"><a href="#features"><span class="tab">Features</span></a></li> (this is the active tab that does not have the class added when clicked. When this li is active knotchtab remains on the other li that no longer has the .active class attributed)
I have a single page website and I would like to add an .active class to my links when I reach a certain point on the page (this will be done by unique div or section id's). The classes are currently empty, so I would need to be able to remove and replace the .active class accordingly.
Having a navigation menu desighned in photoshop, how can I use jquery to add a active state class to my css which can use the same hover style for active menu?
So basically I have this menu, the only problem I have is that I would like the colour of the text depending on which the 'LavaLamp' Image is when loading up to be red. For example when loading up this website (my url to the menu) [URL] I would like the text 'Home' to show red, since it is the active tab on page load.
I am attempting to set it so that upon clicking a link within this Joomla site (from the navigation menu), the link will become bold. I have already implemented CSS for ".active" and set the "LI" class to 'active' to the first class.
I have done a search for the JQuery code to do this, but each example that I tried did not work at all. The class remained to be on the first link, home.
I'm curious if anyone knows how to fix this. Most of the content of my page is 940px wide. The superfish menu, expanding as it should to fit my drop-down heading text, is only about 700px wide. I want to apply a color background to the div that the superfish menu is housed in so that the menu appears to be 100% width.
For some reason, in webkit and firefox, the color of the div that the menu is contained in does not show up, so there's just an empty space in that last 25% or so of the bar.
In IE, it looks correct, though. (the color of the containing div shows through the blank space in the menu, making the menu bar appear to fill the entire width).
Am I missing something in the Superfish menu that makes it appear at 100% width?
I have this script where if users click on a link it will show that particular link in a slideUp, slideDown effect. For example There are two links and Two divs.Both Divs are hidden to start. If the user clicks link 1, Div 1 will appear. If the user clicks link2 Div 1 will close and Div 2 will appear. how do I add a active state when the user clicks on each particular link.
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN" "http://www.w3.org/TR/html4/strict.dtd"> <html xmlns ="http://www.w3.org/1999/xhtml"
I have a web page wich has several list like this one:
So several ul's list wich are inside severals divs of class <div class="languages_cont" >
I need to make active the first <a> of each one this ul's and it need to be done in Js (when i say active i mean the <a> text will become bolded, so right now i've been trying using a each but no luck yet, it only selects the first it encounters.
I am working on the project that will be only one page and the menu will link to the same page. The problem is that i can't add active class to the menu the same we did in the normal linked pages. For example, in css we can see .about .menu ul li .active a { color:#black} . This means the menu will be in black when the user is in the about page. I can't do like this in one page scroll menu as there is only one menu. Are there any ways to let the menu change (add active class)when i scroll to some specific part of the page?
I am using the Jquery Superfish menu within a struts 2 web app. As seen in the attachment, The menu is appearing and the hover delay is working but there are gaps between each menu and its sub menu. Also the root menu items are not all the same with. I am using the example code without changing it. how to get rid of these gaps ?