Forum Replies Created

Viewing 3 posts - 1 through 3 (of 3 total)
  • Author
    Posts
  • in reply to: Timeline is loading to late #1051414

    You can close this.

    Best regads
    Emanuel

    in reply to: Timeline is loading to late #1051302

    Hey,
    I fixed the code from Ismael by my self.
    https://kriesi.at/support/topic/tab-section-link-from-content-in-one-tab-to-another-tab/#post-909792
    I did it this way:

    
    // 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('#'));
    			}
    			if(hash!=''){
    			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 )
    				}, 500 );
    			}
    			}
    		});
    	}
    
    	scrollToTab( '.menu-item a', 'click' );
    	scrollToTab( window, 'load' );
    })(jQuery);
    </script>
    <?php
    }
    

    I put an if-clause around the jumping part, which prevent the error.
    if(hash!='')
    Best regards and thanks for your idea.

    Emanuel

    in reply to: Timeline is loading to late #1050991

    Hello Mike,

    Yes I use this Code Snippet to jump directly to the opened Tabs.

    Best regards
    Emanuel

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