Results 1 to 1 of 1

Thread: JS driven links for navigation

  1. #1
    Join Date
    Aug 2011

    JS driven links for navigation

    Hey guys,

    I am working on a site which has a few pages with "jquery tools tabs" implemented. In my site wide navigation I am linking certain tabs on each page to become the active tab. I am currently using the following format -- href="pageName.html#active_tab_id". This works fine except there is a page jump as expected when using jump links. My problem is that I need to keep the page from jumping at the top. I have tried some combinations of onclick with return false; and other js page link options without success. Below is how the page works:

    Navigation drop down link:
    HTML Code:
    <a href="pageName.html#active_Tab_id" onClick="top.location=this.href;return false;">Nav Link</a>
    This links to the page:

    pageName.html#active_Tab_id and jumps down to the top of the tab contents named #active_Tab_id.

    I need it to open to the page with the tab contents named #active_Tab_id and stay navigated at the top of the page.

    I was trying to think of a way to inject the url into the html link through an array and function.

    I may have this wrong but the array would like something like this:

    HTML Code:
    var activeTab = [];
    activeTab[active_Tab_id] = pageName.html#active_Tab_id';
    activeTab[active_Tab_id2] = pageName.html#active_Tab_id2';
    activeTab[active_Tab_id3] = pageName.html#active_Tab_id3';
    As for the function, well I am a little lost on how to build it to connect to a html link.

    Any help would be great.
    Last edited by alann; 08-23-2012 at 02:51 PM. Reason: more information

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
HTML5 Development Center