Viewing 9 posts - 1 through 9 (of 9 total)
  • Author
    Posts
  • #897466

    Hi :)
    Is there a way to change to change the open tab via the main menu?
    The link in the menu is URL/site1/#tab-1
    When I’m on a different page it opens the page with the correct tab open, but when I’m already on the page URL/site1/ and then click on the link URL/site1/#tab-2, the open tab doesn’t change.
    Is there any way to achieve that?

    Thanks!
    Peter

    #897493

    Hey aditive,
    To link to a tab from the same page try formating your link like this:

    http://yoursite.com/page#tab-1

    Best regards,
    Mike

    #898480

    Hi Mike :)

    sorry for my late reply. I don’t seem to get messages for updated threads.

    That’s how I link to the tabs already.

    Any other ideas?

    Thanks!
    Peter

    #898543

    can not confirm this – on my installation – even if on top in the url window a different tab is opend-
    i can open the another tab even over menu link.

    By the way this to functions.php of your child-theme – to have customised tab hashes:

    add_theme_support('avia_template_builder_custom_tab_toogle_id');

    #898683

    Hi,
    Sorry, I didn’t find your direct link to a tab in your main menu. I do see the tabs in the url you added. Please advise.

    Best regards,
    Mike

    #899644

    Papiermaschinen -> Poperoller -> Beschichten -> HKV 76 or TC 401

    Thanks!
    Again sorry for the delay. same as before :)

    #899684

    Hi,
    I added this code to the end of your functions.php file in Appearance > Editor:

    // custom script
    add_action( 'wp_footer', 'ava_custom_script_tab_section' );
    function ava_custom_script_tab_section() {
    ?>
    <script type="text/javascript">
    (function($) {
    	function scrollToTab(s, e,) {
    		$(s).on(e, function(event) {
    			var anchor, loc, cur, hash, tab, parent, pos;
    
    			if( e == 'load' ) {
    				loc  = window.location.hash;
    				hash = loc;
    			} else {
    				loc = $(this).attr('href');
    				hash = loc.substring(loc.indexOf('#'));
    			}
    	
    			tab = $('.av-section-tab-title[href='+ hash +']');
    			parent = tab.parents('.av-tab-section-outer-container');
    			pos = parent.offset();
    
    			tab.trigger('click');
    			
    			if(hash) {
    				setTimeout( function() {
    					$(window).scrollTop( pos.top - 100 )
    				}, 1000 );
    			}
    		});
    	}
    
    	scrollToTab( '.menu-item a', 'click' );
    	scrollToTab( window, 'load' );
    })(jQuery);
    </script>
    <?php
    }

    and the links seem to work correctly now, Please clear your browser cache and check.

    Best regards,
    Mike

    #900066

    Awesome, thanks! Works perfectly now :)

    #900109

    Hi,
    Glad we were able to help, we will close this now. Thank you for using Enfold.

    Best regards,
    Mike

Viewing 9 posts - 1 through 9 (of 9 total)
  • The topic ‘Change open tab via Main-Menu’ is closed to new replies.