Navigation
This is archived content. Visit our new forum.
  • Author
    Posts
  • #333934

    Rad
    Moderator

    Hi there,

    I still can see error related to google analytics.

    (function(i,s,o,g,r,a,m){i['GoogleAnalyticsObject']=r;i[r]=i[r]||function(){(i[r].q=i[r].q||[]).push(arguments)},i[r].l=1*new Date();a=s.createElement(o),m=s.getElementsByTagName(o)[0];a.async=1;a.src=g;m.parentNode.insertBefore(a,m)})(window,document,'script','//www.google-analytics.com/analytics.js','ga');
    
      ga('create', 'UA-64835903-1', 'auto');
      ga('send', 'pageview');
      ga('set', '&uid', {{USER_ID}}); // Legen Sie die Nutzer-ID mithilfe des Parameters "user_id" des angemeldeten Nutzers fest.

    And this change this custom javascript :

    jQuery(function($){
    
    	$(document).ready(function(){ jump_to_tab( $, $('.x-nav-tabs .x-nav-tabs-item a[href="#' + location.href.split("#").slice(-1)[0] + '"], .x-accordion-toggle a[href="#' + location.href.split("#").slice(-1)[0] + '"]') ); });
    	$('.enable_jump_to').click( function(e){ e.preventDefault(); jump_to_tab($, $('.x-nav-tabs .x-nav-tabs-item a[href="' + $(this).attr('data-jump-target') + '"], .x-accordion-toggle a[href="' + $(this).attr('data-jump-target') + '"]') ); } );
    
    });
    
    function jump_to_tab($, tab_nav) {
    			if(tab_nav.length >=1) {
    	            $(tab_nav).click();
    	            $('html,body').animate({scrollTop: $(tab_nav).offset().top - ( $('.x-navbar').height() + 50 )},700 ,'swing');
            	}
    }    

    to this :

    jQuery(function($){
    
    	$(document).ready(function(){ jump_to_tab( $, $('.x-nav-tabs .x-nav-tabs-item a[href="#' + location.href.split("#").slice(-1)[0] + '"], .x-accordion-toggle a[href="#' + location.href.split("#").slice(-1)[0] + '"]') ); });
    	$('.enable_jump_to').off('touchstart touchend click');
    	$('.enable_jump_to').on( 'touchend click', function(e){ e.preventDefault(); jump_to_tab($, $('.x-nav-tabs .x-nav-tabs-item a[href="' + $(this).attr('data-jump-target') + '"], .x-accordion-toggle a[href="' + $(this).attr('data-jump-target') + '"]') ); } );
    
    });
    
    function jump_to_tab($, tab_nav) {
    			if(tab_nav.length >=1) {
    	            $(tab_nav).trigger('touchend click');
    	            $('html,body').top().animate({scrollTop: $(tab_nav).offset().top - ( $('.x-navbar').height() + 50 )},700 ,'swing');
            	}
    } 

    Hope this helps.

    #334918

    c1s
    Participant

    Hi,

    1) i have inserted the script from the Google Analytics page again. Unfortunately, I cannot reproduce the Syntax error of your screenshot. Could you please have a look if it works now?

    2) I regret that with the change of your last post, the direct linking to the tabnav item doesn’t work.

    Thank you very much for your help!

    #335441

    Paul R
    Moderator

    Hi,

    Upon checking, I don’t see any errors anymore and link to tab is now working.

    Please let us know if you still need help on this.

    Thanks

    #335827

    c1s
    Participant

    Hi!

    The Google Analytics issue is solved, but not my initial question from post #333709:

    I took the code from #65132 of this thread for jumping to a specific tabbed content section and it works perfectly fine on the PC in full screen and also in mobile view.
    On the iPhone, however, the link jumps to the page but not the specific tab section.
    How could this be optimized?

    Thanks a lot.

    #335918

    Zeshan
    Member

    Hi there,

    Please try removing the previous code and using following instead:

    jQuery(function($){
      $(window).load(function() { 
        var selector = $('.x-nav-tabs .x-nav-tabs-item a[href="#' + location.href.split("#").slice(-1)[0] + '"], .x-accordion-toggle a[href="#' + location.href.split("#").slice(-1)[0] + '"]');
        jump_to_tab( $, selector ); 
      });
    
      $('.enable_jump_to').off('touchstart click');
      $('.enable_jump_to').on('touchstart click', function(e){ 
        e.preventDefault(); 
    
        var $this = $(this),
            selector = $('.x-nav-tabs .x-nav-tabs-item a[href="' + $this.attr('data-jump-target') + '"], .x-accordion-toggle a[href="' + $this.attr('data-jump-target') + '"]');
    
        jump_to_tab( $, selector ); 
      });
    });
    
    function jump_to_tab($, tab_nav) {
      if( tab_nav.length >= 1 ) {
        $( tab_nav ).click();
        $('html, body').animate({
          scrollTop: tab_nav.offset().top - ( $('.x-navbar').height() + 50 )
        }, 700);
      }
    }
    

    Thanks!

    #336075

    c1s
    Participant

    Hi There!

    Thanks! I don’t know why, but on the iPhone it doesn’t work!

    #336192

    Zeshan
    Member

    Hi there,

    Upon checking on an iPhone 5, this is working just fine for me now. Please watch this video: https://www.dropbox.com/s/5ux7d76b1bczt7k/iphone5%20accordion%20from%20anchor.mov?dl=0. Would you mind confirming again? Perhaps it’s a caching issue, I’d advise clearing your browser’s cache or testing on a different browser.

    Thanks!

    #338913

    c1s
    Participant

    Hi!

    Even though it still doesn’t work on my personal iPhone (6, in Safari, emptied cache), i am impressed by your effort and more than happy with the current solution. 🙂

    Thanks again for your help!

    #339108

    Rad
    Moderator

    You’re welcome!

    #368766

    bubblekom
    Participant

    Hi, ive just read throug the whole thread, but cant get it to manage it for my own purposes:
    I want to open that accordions by external link (without the need of classes for outgoing link):
    http://bauer-neu.kempire.net/fachwissen/perlen/#collapse-2
    should open the toogle named »Taihiti«.

    Ive pasted this js into my custom javascript-field, but there no way to gave a class on the link:

    	$(document).ready(function(){ jump_to_tab( $, $('.x-nav-tabs .x-nav-tabs-item a[href="#' + location.href.split("#").slice(-1)[0] + '"], .x-accordion-toggle a[href="#' + location.href.split("#").slice(-1)[0] + '"]') ); });
    	$('.enable_jump_to').click( function(e){ e.preventDefault(); jump_to_tab($, $('.x-nav-tabs .x-nav-tabs-item a[href="' + $(this).attr('data-jump-target') + '"], .x-accordion-toggle a[href="' + $(this).attr('data-jump-target') + '"]') ); } );
    });
    
    function jump_to_tab($, tab_nav) {
    			if(tab_nav.length >=1) {
    	            $(tab_nav).click();
    	            $('html,body').animate({scrollTop: $(tab_nav).offset().top - ( $('.x-navbar').height() + 50 )},700 ,'swing');
            	}
    }
    #368883

    Paul R
    Moderator

    Hi,

    Can you specify which links in your site you want to add a class.

    Please note that you need to enable advanced controls for the class field to appear.

    Thanks

    #781311

    PhilTone
    Participant
    This reply has been marked as private.
    #782057

    Rad
    Moderator

    Hi Phil,

    You only need to add enable_jump_to class to your link if it link to same page. If it needs to link outside the page, then please remove it.

    Thanks!

    #782882

    PhilTone
    Participant

    ok when i delete the enable_jump_to it goes to the other page and to the accordion but it doesn’t open it :/

    #783419

    Rad
    Moderator

    Hi there,

    It’s because the link contains a non-existing ID

    http://phil.razvanlazar.de/solutions/#emap

    What you added to the URL is the ID of the accordion, it should be the ID of accordion item.

    Like this,

    http://phil.razvanlazar.de/solutions/#collapse-9

    If still not working, then please remove the script and we’ll start over the testing again. Or you may provide your admin login credentials in private reply.

    Thanks.