Forums

The forums ran from 2008-2020 and are now closed and viewable here as an archive.

Home Forums JavaScript Organic Tabs (Link to a specific tab)

  • This topic is empty.
Viewing 9 posts - 1 through 9 (of 9 total)
  • Author
    Posts
  • #29617
    AndrewChamp
    Participant

    Hello, I wanted to know how, if possible, to link to direct tab so that it’ll be highlighted. Any solutions?

    I already tried "http://mysite.com/index.php#tabtwo" and it doesn’t work.

    Thanks ahead of time.

    #79949
    dcp3450
    Participant

    not quite sure what you mean. need to give more information and/or example.

    #79953
    AndrewChamp
    Participant
    "dcp3450" wrote:
    not quite sure what you mean. need to give more information and/or example.

    If I have the Organic Tab code on http://mysite.com/index.php (for example) I’d like to be able to go directly to a tab (say #3) w/o having to see the 1st tab & manually clicking #3. I want to have a link that will have the 3rd tab highlighted (ie: http://mysite.com/index.php#tabthree)… but that doesn’t work. I’ve seen other tab codes work like that, but this won’t work. Anyother way to get it to work? Thank you.

    #79974
    dcp3450
    Participant

    using an address like:
    http://mysite.com/index.php#tabtwo

    is referencing and anchor. someone using "http://mysite.com/index.php#tabtwo&quot; has "<a name="tabtwo"></a>" in their code where the div or text for tabtwo is located. try putting <a name="tabtwo"></a> where you have "tabtwo" and then place the #tabtwo in your address.

    I use this on my companies site so a user can jump to a specific news store based on id number.

    i have a link:
    <a href="/news/index.html#135">Title of news story</a>

    on the news page i have different stories with <a name="(number)"></a>. When the user selects the link it goes directly to the news story number selected even though the link was on a different page.

    #79991
    AndrewChamp
    Participant
    "dcp3450" wrote:
    using an address like:
    http://mysite.com/index.php#tabtwo

    is referencing and anchor. someone using "http://mysite.com/index.php#tabtwo&quot; has "<a name="tabtwo"></a>" in their code where the div or text for tabtwo is located. try putting <a name="tabtwo"></a> where you have "tabtwo" and then place the #tabtwo in your address.

    I use this on my companies site so a user can jump to a specific news store based on id number.

    i have a link:
    <a href="/news/index.html#135">Title of news story</a>

    on the news page i have different stories with <a name="(number)"></a>. When the user selects the link it goes directly to the news story number selected even though the link was on a different page.

    I know what it is. What I’m saying is that for the "Organic Tabs" script, it won’t work that way and I need a way to link to those tabs.
    Any ideas?

    #61973
    curroqnd
    Member

    Hi Andrew.

    Did you manage to find a solution for this? I’m facing the same problem and I’m totally stuck.

    Cheers.

    C.

    #47458
    cwulff
    Member

    Yeah, I’m stuck on this too. Any thoughts on how to proceed?

    #94074
    moabxj01
    Member

    A quick and dirty “fix”:


    (function(){
    var hash = window.location.hash;
    var $a = jQuery('a[href=' + hash + ']');

    if($a.length>0){
    $a.click();
    }
    })();

    Place this below $(“example-one”).organicTabs(); and it should work…modifying the plugin directly would be better though.

    #246427
    jrodivasupreme
    Participant

    I have the links on another page as:

    about-us.2.htm#core

    and added the code you mentioned:

    (function(){

    var hash = window.location.hash;

    var $a = jQuery(‘a[href=’ + hash + ‘]’);

    if($a.length>0){

    $a.click();

    }

    })();

    Below the line :

    $(“example-one”).organicTabs();

    =========================

    and this worked!!!!

Viewing 9 posts - 1 through 9 (of 9 total)
  • The forum ‘JavaScript’ is closed to new topics and replies.