Navigation
This is archived content. Visit our new forum.

Tagged: 

  • Author
    Posts
  • #1219907

    vasilescu_anton
    Participant

    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,
    Anton

    #1219943

    vasilescu_anton
    Participant

    It also seems that the X-Shortcodes plugin is deactivated and no matter what I do, I cannot make it active…

    #1220165

    Friech
    Moderator

    Hi 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 credentials

    Don’t forget to select Set as private reply. This ensures your information is only visible to our staff.

    Cheers!

    #1221007

    vasilescu_anton
    Participant
    This reply has been marked as private.
    #1221255

    Nabeel A
    Moderator

    Hi 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!

    #1222544

    vasilescu_anton
    Participant

    Hi,

    Thank you, that works! Can you explain a little bit what might have caused the issue?

    Anton

    #1222752

    Nabeel A
    Moderator

    Hey Anton,

    Glad it worked. There could be any conflict which might have caused the problem. Above script will take care of it.

    Thanks!

    #1230334

    vasilescu_anton
    Participant

    Ok 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,
    Anton

    #1232079

    Rad
    Moderator

    Hi 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!