Hi,
I have checked and adapted the code you sent to me through the link, thanks.
it works pretty well when i use a external link, let’s say I use the link from my homepage, my menu, it goes to the right tab, so this is great.
But when i am in the page itself, i can’t change tab using this menu
I have tried to change as requested this:
to this
$( window ).on('load', function(){
or to this
$( document ).ready( function(){`
but I still have the same issue, I don’t have anyother plygin yet plugged, except slider revolution so I dont think I have any confilcts.
here is my page: http://autoecolematheysine.fr/nos-formations/
Here is my code:
jQuery( function($){
$( document ).ready( function(){
scroll_to_tab ( location.href.split("#").slice(-1)[0] );
});
$('.tab-22').on('click', function() {
scroll_to_tab( $(this).attr('href').split("#").slice(-1)[0] );
});
$('.tab-23').on('click', function() {
scroll_to_tab( $(this).attr('href').split("#").slice(-1)[0] );
});
$('.tab-24').on('click', function() {
scroll_to_tab( $(this).attr('href').split("#").slice(-1)[0] );
});
$('.tab-25').on('click', function() {
scroll_to_tab( $(this).attr('href').split("#").slice(-1)[0] );
});
$('.tab-26').on('click', function() {
scroll_to_tab( $(this).attr('href').split("#").slice(-1)[0] );
});
$('.tab-27').on('click', function() {
scroll_to_tab( $(this).attr('href').split("#").slice(-1)[0] );
});
$('.tab-28').on('click', function() {
scroll_to_tab( $(this).attr('href').split("#").slice(-1)[0] );
});
$('.tab-29').on('click', function() {
scroll_to_tab( $(this).attr('href').split("#").slice(-1)[0] );
});
function scroll_to_tab ( tab_id ) {
$( "#" + tab_id ).trigger('click');
$('html,body').stop().animate({scrollTop: $( "#" + tab_id ).offset().top - ( $('.x-navbar').height() + 50 ) },700 ,'swing');
}
});
This is already a great step already, But i would love to be able to understand and fix this issue,
Thanks a lof for your help,