JQuery :: Make A Two Part Navigation Menu (main/sub Category)

Jun 4, 2011

My goal right now is to make a two-part navigation bar where you don't have to reload the whole site, when you click on a link. The navigation bar consists of two <ul> lists with <li> float:left and <a> display:block, so I basically have two lines. It's probably easier to understand if you see it for yourself: jsfiddle (had to change the css style, because I use .less but it works)

When you load the page it's just like that, you have your main category (A,B,C,D,...) and the sub-category (A1,A2,A3,...). What I want: If you click on B, the sub category changes to B1,B2,.... If you click on a sub category the site loads the requested page (with ajax = best solution?!)

My thoughts

At first I thought about just changing the name and href attribute of the second list, but the main categories have different amounts of sub categories, so I would need to add or remove <li>'s. Then I thought about using .load() but I somehow screwed up (of course) and the loaded <ul> doesn't have any css style (wrong order?) and I can't see anything. (with a loaded test.html site containing only the word "test" it worked) Is ajax "overkill" as a solution?

CodeIgniter and the URL

I use CodeIgniter (a PHP framework) for the website and URLs like this: www.example.com/maincategory/subcategory (e.g. example.com/A/A3) That's no problem at all, if I don't use any javascript and reload the whole site every time. But is it possible to change the URL with jQuery when the user clicks through the navigation bar? You click on B, the URL changes to example.com/B all the subcategories change to B1,B2,...When you click on B2 the URL changes to example.com/B/B2 and the site loads the requested page (I guess with ajax, so the navigation stays the same?!)

Minor problem: when you load the site, click on B, then B3 for example, you would get the url example.com/B/B3. If you now save this link, close the site and reopen it with the link, CodeIgniter would load the right site and everything, but the navigation would show A1,A2,.. in the sub category.

Hover vs click

Almost every page where I saw this kind of menu they used hover to change the sub category. But I thought click would be better, so you don't have to avoid touching B,C,D,.. if you want to go from A to A9 for example. Only downside is that you have to click before you see the sub categories.

Summary

A two part navigation menu you can use without reloading, changing URLs (when possible) and probably ajax to load the actual content.

View 2 Replies


ADVERTISEMENT

JQuery :: Paid Request: Subcategories Sliding Down Out Of Main Category?

Jul 27, 2010

I was hoping if someone could do this for me, basically I'd like to have a parentcategory. For example this one:''Remixes''

And when you click on it a couple subcategories slide down from under it. Like this

[Code]...

View 3 Replies View Related

Navigation: Find / Get Parent Category

Jan 1, 2011

I have been working on this navigation for something to do, and I cannot for the life of me figure out how to get the parent category. Here is an example of my navigation:

[Code]....

So it will produce a sub-menu with other jQuery that I worked out. So, what I am trying to figure out is when you click on "Project 003" I want JavaScript (or jQuery) to find what menu-item it belongs to, so in this case "#mi". I know I have to go 2 parents up (li, li), but I can't figure out how to get back down into the anchor to use the .attrib('href') function.

View 2 Replies View Related

JQuery :: Make A Navigation Menu That When A Link Is Clicked?

Mar 9, 2011

I am trying to make a navigation menu that when a link is clicked, loads content into a hidden div, then shows the hidden div, then changed the class of the list item. If the same link is clicked again the class reverts back to what it was before and then the content div becomes hidden.

[Code]...

View 3 Replies View Related

Array Access Which Contains Category Info For Navigation

Mar 15, 2010

I have a multidimensional associative array in JS which contains category information for a navigation. It's actually set up through PHP, which pulls the info from a database then translates it into JS. I know it's set up correctly since I can see it in the source once the page is rendered. However, accessing this array causes external JS code (from my Slimbox files) to be displayed in the nav. It's as if the array is set up right, but accessing the elements brings in Slimbox code as the elements. It's very strange. You can see the effect here.

It's the secondary nav under Home, Featured Items, etc. Each token that is clickable is separated by an asterisk: [URL]. Notice the other page's navs work great! Try the jewelry nav on the Home page and the categories are set up fine. This is because other pages do not link to Slimbox. (And no, the site aint pretty because I wanted to get the hard stuff working before I work on the look). I've heard of jQuery interfering with Slimbox and Lightbox, but my nav is not using jQuery!

View 9 Replies View Related

JQuery :: Make A Sliding Navigation Menu With A Dropdown List?

Aug 31, 2010

Is it possible to make a sliding navigation menu with a dropdown list. Here is an example of the menu I am referring to: [URL]

View 2 Replies View Related

Unable To Make Navigation Menu Using Images By On Mouse Over Function?

Nov 12, 2009

now i am making a navigation menu using images by on mouse over function,i want to make a div that shows menu using css and javascript function

View 1 Replies View Related

Selecting Category Details And Products Linked With The Same Category

Feb 4, 2011

i want to list car category name and car details in a single page but the result is car details are same for every category.

[Code]...

View 1 Replies View Related

JQuery :: Ajax - Script Which Loads New Content Onto The Page When The Main Navigation Links Is Clicked

Sep 21, 2011

I have an ajax script which loads new content onto the page when the main navigation links is clicked. I also have a jquery script which fades divs in and out when another subset of links are clicked.

I guess these scripts essentially do the same thing but the first basically is loading in 'pages' without the page having to refresh. The second is just fading in and out divs that are on a page.

The problem is is that the second script only seems to work once, when the page is loaded.

Here they are:

View 2 Replies View Related

Swap Image - Change The Main Banner Part At The Top

Jun 16, 2009

i have a sliced page from photoshop. how i can change the main banner part at the top so that it gradualy changes over a period of time, i was thinking maybe a swap image thing, but not sure.

View 1 Replies View Related

JQuery :: Incorporate Two Files - If The Main Js Is On The Page Part Of The Page Does Not Work?

Jun 22, 2011

I am trying to incorporate two javascript files (using jQuery) and they are creating a conflict.If the main js is on the page part of the page does not work. If I do not include it my menu and some related features do not work correctly.One code is long so here is the link to it: *I removed Link* (this is the main code for the menu etc)The other js is:

$(document).ready(function(){
Engine.Initialize();
if( !$('body').hasClass('index') && !$('body').hasClass('homepage') ) {[code]....

View 2 Replies View Related

Dynamically Resize A Navigation Div - That Is Present On Every Page - According To Size Of Main Content Div

Apr 29, 2010

I am currently trying to use Javascript to dynamically resize a navigation div (that is present on every page) according to the size of the main content div.

I am currently using the following code;

Code:

This works the first time I go to the site and if I refresh a page. However, if I use my on site navigation to switch between pages the div simply uses the height variable defined within my CSS (this needs to be here for users with JS disabled)

Does anybody have any ideas on what the problem might be. It's as if the script is only executed the first time any page on the site is loaded, but then not again.

View 6 Replies View Related

JQuery :: How To Make Only Part Of Accordion-Header Clickable

Aug 3, 2011

I want only the Text to be clickable in the accordion-header. I thought the header option is the right way to do so, but it doesn't work. Instead of h3 i want only the link to be clickable:
$(function() {
$( "#accordion" ).accordion({header:'a'});
});
<div id="accordion">
<h3><a href="#">First header</a></h3>
<div>First content</div>
<h3><a href="#">Second header</a></h3>
<div>Second content</div>
</div>

View 1 Replies View Related

Mega Menu That When The Main Menu Items Is Hovered Over The Mega Menu The Div Is Displayed?

Nov 5, 2010

I have a mega menu that when the main menu items is hovered over the mega menu the div is displayed. I want to keep the div from being shown off the right of the browser screen. I have the following that determines the amount a div is off the right of the browser:

Code:
function keepMenuLeft(){
var div_width = $("li.hovering div").width();

[code]....

View 1 Replies View Related

Image Insertion Page That Is Part Of A JS WYSIWYG - Put Caption Bar After The Image In The Main Code?

Nov 27, 2011

I have an image insertion page that is part of a JS WYSIWYG. It works okay, but I would like to add a styled caption bar underneath it.

This is what I'm currently using for the caption (inserted by a button):

Code:

This is the code from the insert image page:

Code:

How do I put the caption bar after the image in the main code?

View 1 Replies View Related

JQuery :: How To Make Horizontal Navigation Bar

Dec 9, 2011

I want to make a horizontal navigation bar with jquery, but it dont work. This is my homepage [URL]. And I would like to have a flipout bar by the point "sonstiges". How it works? Here is a link for the Code:view-source: [URL].

View 1 Replies View Related

JQuery :: Add And Remove Classes When Clicking On The Main Menu Links?

Sep 9, 2009

I have a problem with my menu. I am trying to add and remove classes when clicking on the main menu links. For instance when on load, the 'Home' is the current tab clicked, but when I click on 'Contact Me' I would like the class current to be removed from 'Home' and added to

'Contact Me' instead.</div>
<div> </div>
<div>The code im using is the one below.</div>[code]....

View 1 Replies View Related

JQuery :: Remove The Header Part Of The Menu Completely?

Sep 14, 2010

I'm using the default accordion example from the UI Demo page.I would like to remove the header part of the menu completely, where it says 'section'. Is there an option or something to do that??

View 1 Replies View Related

Jquery :: When Inserted, Is Breaking 2 Other Js Scripts In The Page, Including Main Menu?

Apr 6, 2011

But I am doing both front and backend for a project and having an issue with a jquery slider which, when inserted, is breaking 2 other js scripts in the page, including my main menu.Can anyone point me to a resource that outlines best practices for working with more than one js library and/or raw js .I'm doing some tests on the order of the scripts right now, but wanted to put a feeler out there to see if someone has dealt with this before.

View 1 Replies View Related

Jquery :: Slide Down Navigation Menu?

Jan 23, 2009

I am looking to use JQuery which I am really new to and get my navigation submenus to slideDown when the parent is rolled Over. I have multiple parents and children or sub menus and want them to activate individually but without repeating the JQuery over and over again for each.Obviously the goal is to also slideUp on the mouseOut event.Here is the code that I have so far:

<style type="text/css">
span.position
{vertical-align: top;

[code]....

View 1 Replies View Related

Keyboard Navigation Dropdown Menu - Add Support For Keyboard Navigation?

Jan 19, 2009

Ive been working on a site with a dropdown menu. its styled with css and animated with java i would like to add support for keyboard navigation.

var DDSPEED = 5;
var DDTIMER = 5;
main function to handle the mouse events [code].....

View 1 Replies View Related

JQuery :: Navigation - Put The Simple Drop Menu From Css ?

Dec 27, 2011

I am working and designing a website, and have put the simple JQuery drop menu from css tricks on my website, but every time i zoom in and out the website using ctrl +&- the site gets smaller or larger however the navigation moves and some bottoms from the menu drop down to the left or right under the first or last buttons, so does anyone know how i can fix and block the menu from moving around using HTML and its own CSS Style page, let me know.

click on the link below to see the demo for the navigation.

[url]

View 2 Replies View Related

JQuery :: Navigation Menu - Image Fly Over Top On Hover

Jan 14, 2012

I have a navigation menu. Right now, when you hover over a menu item an image flies over the top of it. This image is set in my CSS as "nav li em". However, that image flies in to the same spot for every menu item. This is what I would like: When you hover over Item 2, em2 is invoked for the FlyIn. When you hover over Item 3, em3 is invoked.

Here is my code:
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "[URL]">
<html xmlns="[URL]" xml:lang="en" lang="en">
<head>
<title>help</title>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<script type="text/javascript" src="jquery.js"></script>
<script type="text/javascript">
$(document).ready(function () {
$("#nav a").append("<em></em>");
$("#nav a").hover(function () {
$(this).find("em").animate({ opacity: "show", top: "-34"}, "fast");
var hoverText = $(this).attr("title");
$(this).find("em").text(hoverText); .....

View 4 Replies View Related

JQuery :: Navigation Menu Pulses Unexpectedly?

Oct 25, 2011

I have developed a navigation menu and it works perfectly except for one problem. When hovering from the main menu to the submenu, the submenu fades out then fades back in quickly. I have no idea what is causing this. Here is my code:

var sub_menu_hover = 0;
var main_menu_hover = 0;
$('.showcase_submenu').hover(function(){

[code]....

View 3 Replies View Related

JQuery :: Navigation Menu To Show An Image?

Nov 29, 2011

I'm trying to include a navigation menu where the viewer hovers over the link such as Main or Home and somewhere else in the page it display an image.

Similar to this : [URL]

But instead of pixels, I would just like images to be displayed.

View 2 Replies View Related

Jquery :: Improve Animated Navigation Menu?

Jun 10, 2010

On this link you will see my test site:At the moment I am not too happy with the animation on the navigation menu.As you will see as you click quickly through the various links the animation is very jumpy because of the way I have coded it.Also when you click on the gallery page and then select the various gallery images, the animated ball moves all the way to the left.Here is the JQuery code for the animation:

PHP Code:$(function() {//event object (notice it in the parameter list) contains data about the event handled$(".linkbox").mouseover(function(event){//selectedDiv is the clicked object, so you can do what ever u want on the box clicked ;)var selectedDiv = $(this);var divPosition = selectedDiv.position();var divPositionLeft = divPosition.left;$(".circle").animate( {"left": + divPositionLeft}, "100" );})})function movebacka() {Each page has an include file with the nav menu contents, so every time you click a link in the nav menu, a new page has to load, therefor causing the jumpiness in the animation. What are the best ways to resolve these kind of issues.

View 6 Replies View Related







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