How to link to a jquery slidertab?

564 Views Asked by At

I have been trying out this jquery SliderTabs from this site "http://lopatin.github.com/sliderTabs/". Everything works fine, I'm just having issues using an outside link to go to a specific tab. Here is my following code:

<script>
$(function(){
 $('#customers').sliderTabs();  

if(document.location.hash!='') {
        //get the index from URL hash
        selectedTab = document.location.hash.substr(1,document.location.hash.length);
        $("#customers").sliderTabs('select', selectTab - 1);
    }

  });
</script>

But it just doesn't seem to work for me. Could anyone help me with this?

1

There are 1 best solutions below

1
On

I don't see any documentation for the plugin that relates to public functions you can use. Looking through the source code at line #230 it looks like you want to use the option of "selectTab" instead of "select" like in jquery-ui tabs. https://github.com/lopatin/sliderTabs/blob/master/jquery.sliderTabs.js

$("#customers").sliderTabs("selectTab", selectTab - 1);