Navigation
This is archived content. Visit our new forum.

Tagged: 

  • Author
    Posts
  • #1003829
    JPLamberts
    Participant

    Hi there,

    On my home page https://www.ascent.tech under the “Database Consulting Services” section with the five Icons.

    If one clicks on any of the five icons the “services” page loads and the relevant accordion section of the right service used to open up.

    I did a X Theme and Cornerstone update and now the relevant accordion section won’t open up anymore, only the top accordion section ever opens up, no matter which Icon is clicked.

    There were no code changes to the site at all, all I did was update to the latest version of X and Cornerstone and the functionality disappeared.

    What gives? 🙂

    Please help.

    Thanks

    Johan

    #1003833
    JPLamberts
    Participant

    Hi there,

    I am running:

    Wordpress 4.5.2
    Cornerstone 1.2.4
    X 4.4.2

    Regards

    #1003847
    Christopher
    Moderator

    Hi there,

    Please share the custom JS code you added to achieve this.

    Thanks.

    #1003925
    JPLamberts
    Participant

    Hi there Christopher,

    I did not realize it was custom code for that, thought it was standard functionality. We lost the developer who worked on this. I went and had a look and this is what I found, is this it?

    jQuery(document).ready(function($) {	
    	
        $('.home .x-feature-box-text a:last-child').each( function() {
        	$( this ).parent().parent().parent().find('.x-feature-box-graphic-inner img').wrap( '<a href="' + $( this ).attr('href') + '"></a>' );
        	$( this ).parent().parent().parent().find('.x-feature-box-title').wrap( '<a href="' + $( this ).attr('href') + '"></a>' );
    
        	//x-feature-box-title  
        	$( this ).remove();
        });
    	
    	$('.x-accordion-toggle').click(function() {
    		nracc=$(this).closest('.x-accordion-group').index('.x-accordion-group');
    
    		accheight = $(this).closest('.x-accordion-group').height();
    
    		hght = accheight* nracc;
    
    	    setTimeout(function() {
    	      $('html, body').animate({scrollTop: hght}, 700, 'swing');
    	    }, 300);
      });
    });
    
    jQuery ( function( $ ) {
    
     });
    
    //manage accordion opens
    if(window.location.hash) {
    
      jQuery(".accordion-body.collapse").removeClass("in");
      jQuery(location.hash + " .accordion-body.collapse").addClass("in");
    } else {
      // Fragment doesn't exist
    }
    //menu-main-menu
    jQuery( ".nav_services .sub-menu a" ).on({
      click: function() {
        //nav_item = jQuery( this ).attr( "href" );
        nav_item_hash = jQuery(this).attr('href').split('#')[1];
        window.location.hash = nav_item_hash;
        jQuery(".accordion-body.collapse").removeClass("in");
        jQuery("#"+nav_item_hash + " .accordion-body.collapse").addClass("in");
    //console.log(nav_item_hash);
      }
    });
    

    Thank you.

    Johan

    #1003926
    JPLamberts
    Participant

    Sorry for the lack of indentation, it was indented when I pasted and submitted it.

    #1003950
    Rupok
    Member

    Hi Johan,

    Thanks for sharing the code. I have checked the code and not sure about this. When we are okay with few teaks and cosmetic changes, we can’t assist on in-depth customization. It would be better if you get back to your developer to assist you on this as we can’t assist on the Custom code. Unfortunately this is out of our support scope.

    Thanks for understanding.

  • <script> jQuery(function($){ $("#no-reply-1003829 .bbp-template-notice, .bbp-no-topic .bbp-template-notice").removeClass('bbp-template-notice'); }); </script>