Ok I have it nearly done, for anyone else who needs this.
jQuery(document).ready( function( $ ) {
if($('.eael-advance-tabs').length){
var tabTitle = new Array();
var i =-1;
var hashUrl = window.location.hash;
var hashUrlStrip = hashUrl.replace('#','');
//set ID from title and push to array
$('.eael-tabs-nav ul li .eael-tab-title').each(function(){
$(this).parent().attr('id', this.innerText.replace(/\s+/g, '-').toLowerCase());
var titleId = $(this).parent().attr('id');
tabTitle.push(titleId);
//console.log($(this).parent().attr('id') + ' ' + 'url: ' + hashUrlStrip);
if($(this).parent().attr('id') == hashUrlStrip){
$(this).parent().addClass('active').removeClass('inactive').removeClass('active-default');
} else{
$(this).parent().addClass('inactive').removeClass('active').removeClass('active-default');
}
});
$('.eael-tabs-content div').each(function(){
$(this).attr('id', tabTitle[++i]);
var contentId = $(this).attr('id');
if($(this).attr('id') == hashUrlStrip){
$(this).addClass('active').removeClass('inactive').removeClass('active-default');
} else{
$(this).addClass('inactive').removeClass('active').removeClass('active-default');
}
});
}
});
(Doesn’t currently have functionality for same page anchors only coming from a different URL but could be added with an on click function)
But I have an issue with the first title & content tab keeping the active class, any suggestions?
Thanks