My favorites | Sign in
Logo
Project hosting will be READ-ONLY Wednesday, 7AM PST due to brief network maintenance
          
Feeds:
People details
Project owners:
  edtalmadge

Menu Toggle Adder - JQuery Plugin

JQuery plugin that automatically adds "toggle triangles" to your menu. Includes ability to automatically highlight selected links.

Examples

Download

Download the JQuery Menu Toggle Adder plugin and related files!

How To Use

  1. Download the latest version of JQuery and the Menu Toggle Adder files.
  2. The Menu Toggle Adder files contains "sample.css", "menu_toggle_adder.css" and "ie6_menu_toggle_adder.css".
  3. The Menu Toggle Adder files contains "toggle images". Modify them as needed. Upload the Menu Toggle Adder "toggle images" to your images folder.
  4. Call the JQuery and Menu Toggle Adder Javascript files similar to this:
  5. <script type="text/javascript" src="jquery-1.2.5.min.js"></script>
    <script type="text/javascript" src="jquery.menu_toggle_adder-1.0.0.min.js"></script> 
    
  6. Invoke the Menu Toggle Adder function similar to the below example. This means that you should add the below code (surrounded by "script" tags) to the html document(s) where your menu is displayed. '#menu' should be replaced by the id attribute assigned to the parent unordered list of your menu.
$(document).ready(function(){
$('#menu').menu_toggle_adder();
});

Menu Toggle Adder Settings

There are several settings that can be specified when invoking the menu toggle adder function. For example (don't forget to add the opening and closing script tags):

$(document).ready(function(){
$('#menu').menu_toggle_adder(
{
animate_toggle: 'yes', /* 'yes' or' no'. Use "slide down" animation to show and hide nested lists. */
highlight_selected_link: 'yes', /*  'yes' or 'no'. Add "menu_selected" class to the link (and it's parent) that matches the current page name. */
toggle: 'images/toggle.gif', /*  Path to the toggle image. This is the image that shows when nested ul is hidden. */
toggled: 'images/toggled.gif', /*  Path to the toggled image. This is the image that shows when nested ul is visible. */
toggle_selected: 'images/toggle_selected.gif', /*  Path to the selected, toggle image. This is the image that shows when nested ul is hidden and the link url matches the current page name. */
toggled_selected: 'images/toggled_selected.gif', /*  Path to the selected, toggled image. This is the image that shows when nested ul is visible and the link url matches the current page name. */
}
);
});

Why Use It?

It is tedious for your website user to have to look at a long vertical menu containing, for example, category and sub category links. Collapsing your sub category links will allow your website user to find what she is looking for much easier. Giving the user the ability to expand and contract the menu using toggle images allows them to inspect the full menu without having to reload the page.

Tested On

What Does it Do?









Hosted by Google Code