jQuery Active Menu Plugin

I recently had a project come up that had quite a long menu and I wasn't using a CMS. Considering the length I wanted to use a simple PHP inlcude so that I would only have to make changes to one file rather than each page. The issue was that the client wanted an active state so that the user knew which page they were currently viewing. At that point I was either to scrap the include idea and have a seperate menu for each page or turn to javascript and have it handle active state on the fly, so I choose the latter.

The jQuery Active Menu plugin allows you the power of javascript to determine the page you are currently on and add the proper id (ex. "active") to the corresponding menu item. It comes in handy when building out a static site and will allow you to use the exact same menu code throughout the project.

Example Usage


$(document).ready(function(){
	$(#mainMenu).activeMenu({
        idSwitch: 'active',  // id used for active state
        defaultSite: 'mysite.com',  // site URL
        defaultIndex: 0  // active item used for default site URL
	});
});

Licensing Details

The jQuery Plugins I've made available here are licensed under the Creative Commons license and can be used for personal and/or commercial purposes.

With the Creative Commons license they say you are required to "attribute the work in the manner specified by the author or licensor". However I don't require that you attribute me when using it within your work but by all means your welcome to and if you choose to do so just use this page. I do require that you leave the comments within the plugin in tact as they are.


Twitter Feed

    Flickr Feed

    Latest Posts Heading

    • jQuery Active Menu Plugin

      The jQuery Active Menu plugin allows you the power of javascript to determine the page you are currently on and add the proper id (ex. "active") view more
    • Woody Grunge a free PSD site template

      With this free PSD template I'm including a fully layered photoshop file. The file is well organized and if you have any questions feel free to ...view more
    • 12 Free high-res brick textures for any use

      With this free bundle I'm including 12 High-Res brick textures. They are all 3008x2000 pixels and your free to use them as you wish whether it's view more
    • Create a Javascript rotating quote section

      So for my first tutorial I'm going to create a testomonials section for a website using Javascript and the jQuery library. Quite often a client ...view more