Link to home
Start Free TrialLog in
Avatar of error77
error77

asked on

JQuery Code Add to Anchor ?

Hi all,

I have a script which uses this code to navigate between tabs:

$('#formElem > fieldset').each(function(){
            var $fieldset = $(this);
            $fieldset.children(':last').find(':input').keydown(function(e){
                  if (e.which == 9){
                        $('#navigation li:nth-child(' + (parseInt(current)+1) + ') a').click();
                        /* force the blur for validation */
                        $(this).blur();
                        e.preventDefault();
                  }
            });
      });

I need to be able to call this from an anchor.

Right now I click on the different li's to navigate:

Here's the code:

<div id="navigation" style="display:none;">
                    <ul>
                        <li class="selected">
                            <a href="#">STEP 1</a>
                        </li>
                        <li>
                            <a href="#">STEP 2</a>
                        </li>
                        <li>
                            <a href="#">STEP 3</a>
                        </li>
                        <li>
                            <a href="#">STEP 4</a>
                        </li>
                                    <li>
                            <a href="#">STEP 5</a>
                        </li>
                                    <li>
                            <a href="#">STEP 6</a>
                        </li>
                    </ul>
                </div>

As you can see there's no links so I don't know how to navigate this from some of my links on the same page.

Can anyone help please?


ASKER CERTIFIED SOLUTION
Avatar of Atique Ansari
Atique Ansari
Flag of India image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial