-
AuthorPosts
-
July 18, 2015 at 6:33 pm #333934
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.
July 20, 2015 at 8:58 am #334918Hi,
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!
July 20, 2015 at 11:53 pm #335441Hi,
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
July 21, 2015 at 8:22 am #335827Hi!
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.
July 21, 2015 at 10:02 am #335918Hi 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!
July 21, 2015 at 12:46 pm #336075Hi There!
Thanks! I don’t know why, but on the iPhone it doesn’t work!
July 21, 2015 at 2:37 pm #336192Hi 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!
July 23, 2015 at 10:08 pm #338913Hi!
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!
July 24, 2015 at 2:22 am #339108You’re welcome!
August 25, 2015 at 7:41 am #368766Hi, 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'); } }
August 25, 2015 at 9:32 am #368883Hi,
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
February 5, 2016 at 4:57 am #781311This reply has been marked as private.February 5, 2016 at 1:19 pm #782057Hi 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!
February 6, 2016 at 5:06 am #782882ok when i delete the enable_jump_to it goes to the other page and to the accordion but it doesn’t open it :/
February 6, 2016 at 2:40 pm #783419Hi 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.
-
AuthorPosts