JQuery :: Keyboard Navigation - Active Link Goes To First Element Of Unordered List
Aug 11, 2011
I am trying to develop a jquery based keyboard navigation for my new project.....
My code:
But the problem i face is that when my active link goes to first element of unordered list and then i press up arrow key, then i lose track of my active link...
I am not terribly familiar with Javascript but i am looking forward to learning, and currently the problem I am facing is this:I have an a file being included to an .shtml document, that serves as my navigation, the code is like this:
i have a menu and i would like to change the color of the Categories which have subcategories only. In my example the basic categories are: News , Announcements , Contact and Career. Only Announcements and Career categories have subcategories. So i would like those two to turn green. The fact is that the list items include a href ,so i don't know how to access those "a href" combined with "this".
here is a link on which you can find how to create keyboard navigation...Click here to visit keyboard enabled web page tutorial..."All intelligent thoughts have already been thought; what is necessary is only to try to think them again." http:[url]....
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.
Now, I'd like to remove the link from the "Second main" because it has a submenu. I know that I can get that exact item using $("ul.sub-menu").parent() but how do I unwrap the link in it?
I'm building a WordPress site with a nice jQuery effect that fades/unfades images within a navigation menu on rollover. So when the mouse moves off the image, the colored image should fade back to reveal the original non-colored image. This works perfectly as-is, but client wants the active page to keep its colored/ highlighted menu image when mouse has moved off of it. The bolded line of the code is where I tried to set that up...
Code: <?php wp_nav_menu( array( 'container_class' => 'menu-header', 'theme_location' => 'primary' ) ); ?> <script type="text/javascript"><!-- this is from [URL]--> // make nav images highlight on hover // when the DOM is ready: $(document).ready(function () { // find the navigation elements and hook the hover event $('#mainmenu li').hover(function() { // on hovering over, find the element we want to fade *up* var fade = $('> div', this);
// if the element is currently being animated (to a fadeOut)... if (fade.is(':animated')) { // ...take it's current opacity back up to 1 fade.stop().fadeTo(250, 1); } else { // fade in quickly fade.fadeIn(250); }}, function () { // on hovering out, fade the element out if (!is_page(current)){ var fade = $('> div', this); if (fade.is(':animated')) { fade.stop().fadeTo(3000, 0); } else { // fade away slowly fade.fadeOut(2000); }}});}); </script>
WordPress should know whether the page is 'current' or not, so why doesn't this work? Currently the nav images remain highlighted when the mouse moves away. If I remove my attempt (the bolded line of code) then nav rollovers work beautifully, but active page still isn't represented with a colored nav menu image.
I'm fairly new to JQuery but can generally feel my way around. Would it be possible to alphabetize an unordered list when a page loads? i know this is kind of 'contrary' to the definition of unordered but it would seem like something JQuery could do. For example, if I had the following list coded into a page,
This is myI use the jQuery.load() function to load content from a page that should get in an <ul> element.At the moment the file contains plain text, and it works, but when i put the content in <li> elements it stops working.
I have the following DOM structure (unordered list), that I would like to sort on the a href tag name using jQuery – specifically the TinySort plug-in [URL] Structure is as follows:
If I have the following: <div class="jcarousel-clip jcarousel-clip-horizontal" style="width: 459px; height: 220px;"> <ul id="mycarousel" class="jcarousel-list jcarousel-list- horizontal" style="height: 220px; width: 918px; left: 0px;"> <li class="jcarousel-item jcarousel-item-horizontal jcarousel- item-1 jcarousel-item-1-horizontal" jcarouselindex="1"></li> <li class="jcarousel-item jcarousel-item-horizontal jcarousel- item-2 jcarousel-item-2-horizontal" jcarouselindex="2"></li> <li class="jcarousel-item jcarousel-item-horizontal jcarousel- item-3 jcarousel-item-3-horizontal" jcarouselindex="3"></li> </ul></div> Trying to figure out how I can do a .each on each <li> and then add an additional style to the last <li> in the list.
I want to modify the appearance of an unordered list by assigning a value to each list item and then setting the custom properties for each list item. At first I was thinking of assigning a number to each list item and then controlling it's properties via that number.But now I'm wondering if jQuery can do a search for the list items content.
I am really stumped on how to use jquery to code this. I looked at a lot of different slider plugins for jquery and I easySlider1.7 uses lists for the sliding effect so that is what I want to use. But I am having problems with creating the nested list slider. It's really hard to explain what I want so I created this.
Here is my list that I want to use for my navigation idea.
I have nested unordered list I need to display as horizontal menus below each other.
[Code]...
And when I click on a Menu 2 submenu is shown for it. And hides Menu 1 submenus. The problem is I need this for multilevel. The result in the will be end showing div's below the menu.
I'm setting up a web page and think jQuery will be able to sort this out for me.
I have an unordered list (5 items so far, but a few more may need to be added). On clicking on any of the items I need three things to happen on the page:
1. place a picture into a div 2. place a caption into another div 3. place a title into a third div
Clicking on a second item needs to hide these and show that item's related three bits.
So, is jQuery/javascript my best tool, how I can achieve it?
I have an unordered list that I am using as a menu. This list contains sub lists.
I found out how to get the index of the primary unordered list item that is being hovered but I am not getting the syntax correct to reference the individual items of this listto get the HTML, the position, height and lengthof this item.
$(" #nav li").hover(function(){ // Locate the index of the singular list item that is being hovered var index = $(this).parent().children('li').index(this); // This is incorrect var $itemObject = $(this).parent().children('li')[index];
I use unordered list item (<ul>) to replace select type <select> (select) in my form. I have problem on bind the value after submit the form. Because <ul> is not a form element. May i know how should I overcome it?
What i intend to do is similar effect as google contact book: 1. User click ADD button, then <ul> and <textbox> will be appended into the form. 2. After form submitted, user can see what are the value he has entered earlier. I can bind the textbox, post the unorder list item with hidden element. but i have no clue how to bind the unordered list item..
Kindly refer to my code as below. It is working except cannot bind unordered list item... p/s: I am using PHP + JQuery.
I'm trying to create an unordered list dynamically and then turn it into jQuery UI tabs... I think I'm having problem with syntax here, I managed to create the list and turn it into the widget, but those tabs don't look right, they have the outline of the widget but the content doesn't have actual tabs, so my guess is it only 'kind of worked'
$ ( "#doc3" ). append
[Code].....
is this the way to do it? (for now its just the test, eventually i want to use for loop to create the list and pull data from an array)
I was wondering how to make URL...by Karl, work with an unordered lis instead of divs. I tried the below but did not work. I think what I have done here ('.links:visible');looks plain wrong (I can't put a class or an Id in there right??)[code]