Viewing 12 posts - 1 through 12 (of 12 total)
  • Author
    Posts
  • #1250606

    I’m building a website using your wonderful theme. I really love it, but I have a problem with tab section. The site is https://croissant.grachev.eu
    Take a look at the image:
    screenshot

    The section has 3 tabs, the 1st one is open by default. When I click on any other tab, it opens and I see its URL in my browser’s address bar. When I copy this URL and paste it in another browser (or another browser’s window/tab, doesn’t matter) — looks like it opens the correct tab, but doesn’t scroll to that tab. Instead of it, the site opens from the very beginning. Hope you understand what I mean.

    And problem #2 — I can’t access tabs from the menu, the links don’t work at all. :(

    I have tried all the “solutions” I could find in this forum, but none works for me. I can give you access to the admin area, to the FTP — anything you need. Please help me!

    • This topic was modified 4 years, 2 months ago by grabowski.
    #1251063

    OK, this code helps (more o less) to scroll to the desired tab:

    function custom_id_script(){
      ?>
      <script>
    (function($){
      $(document).ready(function(){
    $("a.av-section-tab-title").each(function() {
       var $this = $(this);       
       var _href = $this.attr("href"); 
       var itemId = _href.substring(1, _href.length);
       $this.attr("id", itemId);
    });
    });
    })(jQuery);
    </script>
    <?php
    }
    add_action('wp_footer', 'custom_id_script');

    The URL in the address bar changes, but the tab itself doesn’t open.
    Any ideas please?

    #1251718

    What a wonderful support forum! Anyone is going to help me???

    #1252181

    Hi,

    We are very sorry for the late response. The following snippet should make the page scroll to the tab section when the anchor is the same as one of the tab section titles. Please add it in the functions.php file.

    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( '.av-active-burger-items a', 'click' );
    	scrollToTab( window, 'load' );
    })(jQuery);
    </script>
    <?php
    }
    

    Best regards,
    Ismael

    #1252219

    Ismael, thank you for your response!

    No, it doesn’t work. Moreover, when with this snippet, the menu remains open.

    #1252937

    Hi,

    Thank you for the update.

    Did you remove your custom script after adding the recommended snippet? Please post the login details in the private field so that we could check the script further.

    Best regards,
    Ismael

    #1252958

    Yes, I removed that “custom” script. Without that script it works even worse than with it.

    But the most important thing is that at the top of the page there’s a canvas animation. So I need to place links to the tabs inside this animation. I’d like to have some “universal” script to do that.

    Admin details are in the private content.

    #1253937

    Hi,

    Thank you for the update.

    We added the script again and it seems to be working properly on our end. The page scrolls to the tab section and open the appropriate content. Please try to remove the browser cache and hard refresh the page, or check it incognito mode.

    Best regards,
    Ismael

    #1253953

    It still doesn’t work. Anyway, thank you for the attempt to help me with this trouble.
    You should add this feature by default in your next updates. Sometimes it’s very necessary.

    • This reply was modified 4 years, 2 months ago by grabowski.
    #1254797

    Hi,

    That is odd. It does work properly on our end, with or without the previous script that you created. Did you remove the browser cache or history, or hard refresh the page?

    Best regards,
    Ismael

    #1256084

    Yes, I did everything. I even tried it in 5 different browsers.

    #1257860

    Hi,

    Sorry for the delay. Which browser are you using? We are testing the page on Firefox Windows 10 and the script is working as expected. It scrolls to the tab section and open the appropriate tab when clicking on the menu item, or when an anchor exists after loading a page.

    Best regards,
    Ismael

Viewing 12 posts - 1 through 12 (of 12 total)
  • You must be logged in to reply to this topic.