Q:

jQuery Tabs using External URL

I'm using the below code for a simple jquery tabs effect. It works great, however, I would like to be able to use a link like so:
<a href="" class="tab-link-1">Tab Link 1</a>

I'd like to be able to use this link on a different page to the one with the tabs on. Then, ideally once the link take the user to the new page (with the tabs on) the page will load with the chosen tab already open, or with the current class. Any tips please?
$(".tabs-menu a").hover(function(event) {
    event.preventDefault();
    $(this).parent().addClass("current");
    $(this).parent().siblings().removeClass("current");
    var tab = $(this).attr("href");
    $(".tab-content").not(tab).css("display", "none");
    $(tab).fadeIn();
});

A:

From the different page, add some sort of URL parameter to your link to the page with the tabs on it. For example http://yourpage.com/?active_tab=1
From there you need to search for the the active_tab url parameter on document ready and then do the appropriate class adding in jquery.
Something like this should do the trick!
$(document).ready(function() {
    var search = window.location.search; //gives search string of url i.e. ?param1=a&param2=b
    var searchAry = search.split('&'); //split up the search string based on & delimeter. if theres no other params you won't need to do this
    var tabActive;
    for (var i = 0; i < searchAry.length; i++) {
        var tmp = searchAry[i].substring(1); //remove '?' or '&' at beginning of each string
        if (tmp.indexOf('tab_active') > -1) { //if the current param is the tab_active param
            var tabActive = tmp.replace('tab_active=', ''); //parse out the number
        }
    }

    if (tabActive) {
        var elemClass = '.tab-link-' + tabActive;  
        $(tabActive).parent().addClass('current');
    }
});

