Tagged: tab section link
Tab section link doesn’t scroll down to the exact tab section. It opens the main page in the beginning/
https://ftc.community/#av-tab-section-1-3 and this is a tab section https://yadi.sk/i/_4bdXIHv4dzlmA
1. What should I add in the link to scroll down and open the third tab?
For example if I need to make ling to the exact tab section in a blog post or menu section/
According to your documentation, it should be possible. https://kriesi.at/documentation/enfold/tab-sections/#toggle-id-1
I found the similar request here https://kriesi.at/support/topic/link-to-a-tab-in-a-tab-section/#post-1214140
2. How to change the tab section link?
I will be very grateful for the help
Hey Sergio,
Thank you for the inquiry.
You can use this snippet to make the window automatically scroll to the tab section element on page load.
add_action('wp_footer', function() {
?>
<script>
document.addEventListener("DOMContentLoaded", function() {
var anchor = window.location.hash.substr(1);
var tabTitle = document.querySelector('.av-section-tab-title[href="#' + anchor +'"]');
if(tabTitle) {
var position = tabTitle.getBoundingClientRect().top;
window.scrollTo(0, position);
}
return false;
});
</script>
<?php
}, 9999);
Best regards,
Ismael