Support for Drupal 7 is ending on 5 January 2025—it’s time to migrate to Drupal 10! Learn about the many benefits of Drupal 10 and find migration tools in our resource center.
I have three tabs that are displayed below the main content. By default, none is selected. On click, their content appears below the tabs.
Now I want to scroll to the div of the tabs once a tab is clicked so that the tabs appear on top of the page and the content is visible below them. But I can't figure out a way to do that.
The problem is that the content of the tabs can easily be hidden if the tabs, when clicked, are at the bottom of the viewport.
Comments
Comment #1
suaperdevel CreditAttribution: suaperdevel commentedI fix this issue implement a Javascript Code in a custom module, simply add this code:
Comment #2
suaperdevel CreditAttribution: suaperdevel commented