SitePoint Sponsor

User Tag List

Results 1 to 2 of 2

Hybrid View

  1. #1
    SitePoint Member
    Join Date
    Jan 2013
    Posts
    8
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    JS help with WordPress project using Organic Tabs

    Hi All, good to be back after a while (my old email and username now seem to be in the void!),

    Wondering if you could help...

    I've just inherited a WordPress project which uses Organic Tabs. Great plugin, works fine. But the client has just asked if this addition is possible.

    Please see http://www.heritage-motor-centre.co....etings-events/ for the existing page with 4 tabs (Intro, Rally, etc.) and related content below.

    The plugin simply shows or hides content on the same page depending on which tab link you click. The old standard of 'tabs' across the top and shown / hidden content div underneath.

    The item sits within the content of the page and the tabs and content switches work fine. However, they also have other links within the header nav of the site which they also want to achieve the same thing - i.e. clicking on the link in the header nav performs the same switch as clicking the corresponding tab in the content area. If you go to the top nav > planning a visit > club meetings & events > rally packages (for example).

    I appreciate that the header links are not inside the designated div (which is required using the code out of the box) but does anyone have any suggestions on how I could add to the existing JS to achieve this?

    Thanks in advance,

    Rik

  2. #2
    SitePoint Member
    Join Date
    Jan 2013
    Posts
    8
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Aaah well, solved it. BTW, I added to following code just after my 'calling' function line...

    Code:
    $("#tabbed-content").organicTabs();
    ...with...

    Code:
    (function(){
    var hash = window.location.hash;
    var $a = jQuery('a[href=' + hash + ']');
    if($a.length>0){
    $a.click();
    }
    })();
    ...and life is good.

    Rik


Bookmarks

Posting Permissions

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