Tagged: x
-
AuthorPosts
-
October 17, 2016 at 4:24 pm #1219907
I have a site where all of a sudden the accordions have stopped working on the mobile version. I have tried adding the code below but the problem persists…
jQuery(document).ready(function($) { if ( $(‘html’).hasClass(‘touchevents’) ) { $(‘.vc_tta.vc_general .vc_tta-panel-title > a, .vc_tta.vc_general .vc_tta-panel-title > a’).off(‘click touchstart touchend’); } });
The accordions are available for logged in users so please let me know and I will provide access if needed.
Thank you,
AntonOctober 17, 2016 at 5:07 pm #1219943It also seems that the X-Shortcodes plugin is deactivated and no matter what I do, I cannot make it active…
October 17, 2016 at 8:39 pm #1220165Hi There,
Thanks for writing in! Would you mind providing us with login credentials so we can take a closer look? To do this, you can make a post with the following info:
– Link to your site
– WordPress Admin username / password
– FTP credentialsDon’t forget to select Set as private reply. This ensures your information is only visible to our staff.
Cheers!
October 18, 2016 at 11:13 am #1221007This reply has been marked as private.October 18, 2016 at 2:34 pm #1221255Hi again,
To fix the issue, just add the following jQuery script in your Customizer via Appearance > Customize > Custom > Edit Global Javascript
jQuery(document).ready(function($) { $('.x-accordion-heading').on('click touchend',function(e) { e.preventDefault(); parent = $(this).parents('.x-accordion-group'); accBody = parent.find('.accordion-body'); accHead = accBody.siblings('.x-accordion-heading').find('.x-accordion-toggle'); accBody.toggleClass('in').animate({'height': '100%'}, 300); }); });
Don’t forget to clear your browser’s cache after adding the code. Let us know how this goes!
October 19, 2016 at 12:01 pm #1222544Hi,
Thank you, that works! Can you explain a little bit what might have caused the issue?
Anton
October 19, 2016 at 2:19 pm #1222752Hey Anton,
Glad it worked. There could be any conflict which might have caused the problem. Above script will take care of it.
Thanks!
October 25, 2016 at 2:02 pm #1230334Ok so after some more checking I realized that your code made it work on the phone/ipad but now on the computer, once you click on the accordion, it opens but then it closes back in a few fractions of a second. Can you please take a look at it again?
Thanks,
AntonOctober 26, 2016 at 3:07 pm #1232079Hi there,
Please try this one
jQuery(document).ready(function($) { $('.x-accordion-heading').on('click touchend',function(e) { if( $(window).width() > 979 ) return true; e.preventDefault(); parent = $(this).parents('.x-accordion-group'); accBody = parent.find('.accordion-body'); accHead = accBody.siblings('.x-accordion-heading').find('.x-accordion-toggle'); accBody.toggleClass('in').animate({'height': '100%'}, 300); }); });
That should exclude desktop accordion.
Thanks!
-
AuthorPosts