Jquery - Select tab via url

后端 未结 4 854
既然无缘
既然无缘 2021-01-15 23:42

I have the following jquery code that allows me to use tabs, to tab back and fourth between content/divs. My question is using the code below, how could I have it load the i

4条回答
  •  渐次进展
    2021-01-16 00:20

    Hopefully this will help: -

    var tab_id = $(this).attr('href');
    var split = tab_id.split('#');
        split = split[1];
    
    if (split = "page 2") {
    
    window.alert(split);
    
    } else {
     // Default condition   
    
    }
    

    JS Fiddle Example here - http://jsfiddle.net/aNMBW/

提交回复
热议问题