Lappeenranta

LOGO LPR Shukokai1979
jQuery(document).ready(function ($) { //get the hash tag //hash exist //tämä katsoo onko tabi muu kuin eka, jos on animoi vikalla funkkarilla setTimeout(function () { var current = window.location.href var current = current.split('#tab') if (current.length > 1) { showAndScrollToTab($, current) } }, 200); // change the browser url according to selected tab $('.elementor-tab-title[data-tab]').click(function () { var current_location = window.location.href; current_location = current_location.split('#') window.location = current_location[0] + '#tab' + $(this).attr('data-tab') }) // activate tab also from anchor link in the same page $('a').on('click', function () { var anchorUrl = $(this).attr('href') var anchor = anchorUrl.split('#tab') if (anchor.length > 1) { showAndScrollToTab($, anchor) } }) }) function showAndScrollToTab($, current) { $('.elementor-tab-title').removeClass('elementor-active') $('.elementor-tab-title[data-tab="' + current[1] + '"]').addClass('elementor-active') $('.elementor-tab-content').hide(); $('.elementor-tab-content[data-tab="'+current[1]+'"]').show(); // scroll to var headerHeight = $('#header').height() // put here your header id to get its height. $([document.documentElement, document.body]).animate({ scrollTop: $('.elementor-tab-title[data-tab="' + current[1] + '"]').closest('.elementor-widget-wrap').offset().top - headerHeight }, 200) }