• Resolved luciditylt

    (@luciditylt)


    Hello im interested if its possible to fix jettabs for elements plugin usability bug. Im trying to make a link from the home page to tab. Especially in the mobile version.
    For default first tab your plugin works but not working with closed tabs.
    I make selection of tab with this link example:
    ../#tab-name&jet-toggle-tab-name

    Maybe there is any workaround to make it work so auto scoll moves screen to the content start?

    And the same problem with scrolling inside tabs page when pressing on tab.

    The page I need help with: [log in to see the link]

Viewing 3 replies - 1 through 3 (of 3 total)
  • Plugin Author malihu

    (@malihu)

    Hi,

    You can use plugin’s scrollTo method to scroll the page programmatically, but you’ll need to add a small js script in your theme/template… Can you do this?

    The easiest way would be to edit your theme/child-theme footer.php template and add the following script right above the closing body tag (above </body> and below wp_footer() function):

    (function($){
    	
    	$(window).on("load",function(){
    		
    		//scroll to content on page load 
    		setTimeout(function(){
    			scrollToTabContent($(".jet-tabs__control.active-tab"));
    		},200); //small delay to make sure jet-tabs has done its thing
    		
    		//scroll to content on click
    		$(".jet-tabs__control-wrapper").on("click",".jet-tabs__control",function(){
    			scrollToTabContent($(this));
    		});
    	});
    	
    	//scroll to content function
    	function scrollToTabContent(activeTab){
    		if(activeTab.length){
    			var activeTabTargetID="#"+activeTab.attr("aria-controls");
    			$.mPageScroll2id("scrollTo",activeTabTargetID);
    		}
    	}
    	
    })(jQuery);

    This script will fix both issues (i.e. scrolling to content on page load and on tab click).

    Hope this helps

    Thread Starter luciditylt

    (@luciditylt)

    Wow, very very thankyou! works perfect

    Plugin Author malihu

    (@malihu)

    You’re welcome 🙂

Viewing 3 replies - 1 through 3 (of 3 total)

The topic ‘Jet tabs’ is closed to new replies.