Autoscroll-Position (when Tab clicked) changeable?
-
Okay, first off…I want to say that Tabby is a really good plugin and works perfectly!
I just wanted to ask something and here is the scenario:
– The first tab is opened
– I click on another tab
– The tab opens and scrolls to the top of the page
– So you can see the tab-name and the content in it perfectlyHere is the problem:
– Tabby doesn’t recognize that I have fixed Main-Menu
– So when I hit another tab you can’t see the tab-name because the fixed Main-Menu is laying over it…So here is my question:
Is the Scroll-Position changeable?And why not jump to the opened tab when you have the target in the url?
I’ve put it in your Tabby.js and it works! ??Here is the JS-Snippet:(not so nice coding..but I don’t care! XD)
function getUrlParameter(sParam){ var sPageURL = window.location.search.substring(1); var sURLVariables = sPageURL.split('&'); for (var i = 0; i < sURLVariables.length; i++){ var sParameterName = sURLVariables[i].split('='); if (sParameterName[0] == sParam){ return sParameterName[1]; } } } //target-text in URL var targetTabText = getUrlParameter('target'); var tabTextString = $(".responsive-tabs__heading--active").text(); var tabTextStringArr = tabTextString.toLowerCase().split(' '); var activeTabText = tabTextStringArr[0] + '-' + tabTextStringArr[1]; //check if targettext is active tab text if (targetTabText === activeTabText){ //scroll to opened tab postion window.scrollTo(0, $(".responsive-tabs__heading--active").position().top); }
- The topic ‘Autoscroll-Position (when Tab clicked) changeable?’ is closed to new replies.