Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 7599543
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 30, 20262026-05-30T22:41:16+00:00 2026-05-30T22:41:16+00:00

I have the following tabs in jquery-tools: <!– tabs –> <ul class=css-tabs> <li><a href=/example/a>ABC</a></li>

  • 0

I have the following tabs in jquery-tools:

<!-- tabs -->
<ul class="css-tabs">
    <li><a href="/example/a">ABC</a></li>
    <li><a href="/example/b">DEF</a></li>
</ul>

<!-- single pane. it is always visible -->
<div class="css-panes">
    <div style="display:block"></div>
</div>

And I have history turned on.

So when I press on the first tab ABC, I have the url:
http://www.example.com/example/a#/example/a

And once the second tab DEF is clicked the url looks like this:
http://www.example.com/example/b#/example/b

I don’t like how the url looks like and I would prefer if the tab history was according to the name of the tab (ABC and DEF): http://www.example.com/example/a#ABC and http://www.example.com/example/b#DEF

I have been looking for this for quite a while but couldn’t find anything about how this can be done…

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-30T22:41:17+00:00Added an answer on May 30, 2026 at 10:41 pm

    Ok, so I’m going to answer my own question >_<

    No I didn’t find the solution somewhere on the net, I solved it myself…

    The solution is for jquery-tools version 1.2.6 stable

    In jquery-tools code which concerns the history tool, you change it from this:

    (function(a){var b,c,d,e;a.tools=a.tools||{version:"v1.2.6"},a.tools.history={init:function(g){e||(a.browser.msie&&a.browser.version<"8"?c||(c=a("<iframe/>").attr("src","javascript:false;").hide().get(0),a("body").prepend(c),setInterval(function(){var d=c.contentWindow.document,e=d.location.hash;b!==e&&a(window).trigger("hash",e)},100),f(location.hash||"#")):setInterval(function(){var c=location.hash;c!==b&&a(window).trigger("hash",c)},100),d=d?d.add(g):g,g.click(function(b){var d=a(this).attr("href");c&&f(d);if(d.slice(0,1)!="#"){location.href="#"+d;return b.preventDefault()}}),e=!0)}};function f(a){if(a){var b=c.contentWindow.document;b.open().close(),b.location.hash=a}}a(window).bind("hash",function(c,e){e?d.filter(function(){var b=a(this).attr("href");return b==e||b==e.replace("#","")}).trigger("history",[e]):d.eq(0).trigger("history",[e]),b=e}),a.fn.history=function(b){a.tools.history.init(this);return this.bind("history",b)}})(jQuery);
    

    To this: (no need for the new lines, you can remove them and return it to one line)

    (function(a)
    {
        var b,c,d,e;a.tools=a.tools||{version:"v1.2.6"},a.tools.history={init:function(g){e||(a.browser.msie&&a.browser.version<"8"?c||(c=a("<iframe/>").attr("src","javascript:false;").hide().get(0),
        a("body").prepend(c),setInterval(function(){var d=c.contentWindow.document,e=d.location.hash;b!==e&&a(window).trigger("hash",e)},100),
        f(location.hash||"#")):setInterval(function(){var c=location.hash;c!==b&&a(window).trigger("hash",c)},100),d=d?d.add(g):g,
        g.click(function(b){var d=a(this).attr("href");
        c&&f(d);if(d.slice(0,1)!="#"){location.href="#"+a(this).attr("name");return b.preventDefault()}}),e=!0)}};
    
        function f(a)
        {
        if(a)
        {
            var b=c.contentWindow.document;
            b.open().close(),
            b.location.hash=a
        }
        }a(window).bind("hash",function(c,e){e?d.filter(function(){var b=a(this).attr("name");return b==e||b==e.replace("#","")}).trigger("history",[e]):d.eq(0).trigger("history",[e]),b=e}),
        a.fn.history=function(b){a.tools.history.init(this);return this.bind("history",b)}
    }
    )
    

    The changes are two simple changes:
    This:

    location.href="#"+d
    

    was changed to this:

    location.href="#"+a(this).attr("name")
    

    And this:

    var b=a(this).attr("href");
    

    was changed to this:

    var b=a(this).attr("name");
    

    Also one more important thing, you need to add the attribute “name” to your tabs and put the name you want to appear in the address after the # (in my case I want the same link/name of the tab to appear), like this:

    <!-- tabs -->
    <ul class="css-tabs">
        <li><a href="/example/a" name="ABC">ABC</a></li>
        <li><a href="/example/b" name="DEF">DEF</a></li>
    </ul>
    
    <!-- single pane. it is always visible -->
    <div class="css-panes">
        <div style="display:block"></div>
    </div>
    

    And that’s it you, now have a working jquery-tools’ tabs with history working with “#name of the tab” and not the “#href link” 😀
    Like these:

    http://www.example.com/example/a#ABC

    http://www.example.com/example/b#DEF

    If you don’t want the “name” attribute but the id or class, then change where I put name to id or class, but make sure to put id or class in your tabs too…

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have a (parent) window containing JQuery tabs: <div id=tabs> <ul class=tabHeader> <li><a href=?ctrl=doSomething
Let's consider following, simplified example: We have 2 tabs withing <rich:tabPanel switchType=ajax> , each
I have the following JQuery Code concerning my tabs : $(#onglet>ul>li).click(function(){ $(#onglet ul li).removeClass('Selectionne').addClass(OngletPrincipal);
I have the following jQuery script on my site to switch tabs without reloading
jQuery 1.7.1, jQuery UI tabs. I have the following HTML representing tabs, <div id=tabs>
I have the following Jquery which has 4 tabs which have 4 different searches
I have the following code to generate Jquery UI tabs: <div id=tabs-loading-message style=display:none>Loading, Please
I have the following jquery code that allows me to use tabs, to tab
I have following problem: I have built a tabbar application with 4 tabs. I
I have the following code for creating tabs. It works at the end of

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.