Skip to content Skip to sidebar Skip to footer

Defining Default Jquery Tab Based On Url

I have a jQuery search script that uses tabs for the user to define the search type they want. A tab is selected as the default by using $('#type_search').click(); however this cau

Solution 1:

Ah, I had that problem too. It's pretty simple. On page ready you just take the anchor from the URL and simulate a click.

$(document).ready(function() {
  url = document.location.href.split('#');
  $('#'+url[1]).click();
});

Post a Comment for "Defining Default Jquery Tab Based On Url"