Okay
  Public Ticket #935209
Disable scroll to top accordion
Closed

Comments

  •  2
    Eliacin started the conversation

    Hi, i have a little issue with the accordion shortcode, when i clicked automatically move to the top of the page, and i dont want to do this, can u tell how can i disable that.

    Thanks

  •  895
    TheFox replied

    Hello Eliacin,

    You can do this but you will need to go edit the customjs.js file, also you should use a child theme to do this.

    You need to go edit the file and change this :

    function set_tabs() {
        var strHash = document.location.hash;
        j$('.wpb_accordion_section h3 > a').click(function(){
                setTimeout(function(){
              
                j$(".rd_img_carousel").trigger('updateSizes');
                j$(".rd_testimonials").trigger('updateSizes');
                j$(".partners").trigger('updateSizes');
                j$("ul").trigger('updateSizes');
                },800);
                var target = j$(this);
                if(j$('.header_bottom_nav').length > 0){
                var h_height = j$("#header_container").height();
                }
                else if(j$(".header_to_shrink").length > 0) {
                var h_height = "55";
                }
                else {
                var h_height = "55";
                }
                setTimeout(function(){
                    j$('html,body').animate({
                        scrollTop: target.offset().top-h_height
                    }, 1000);
                    
                j$(".rd_img_carousel").trigger('updateSizes');
                j$(".rd_testimonials").trigger('updateSizes');
                j$(".partners").trigger('updateSizes');
                j$("ul").trigger('updateSizes');
                },400);
              
        
        });
    

    to

    this 

    function set_tabs() {
    var strHash = document.location.hash;
    j$('.wpb_accordion_section h3 > a').click(function(){
                setTimeout(function(){
              
     j$(".rd_img_carousel").trigger('updateSizes');
     j$(".rd_testimonials").trigger('updateSizes');
     j$(".partners").trigger('updateSizes');
     j$("ul").trigger('updateSizes');
     },800);
    var target = j$(this);
     if(j$('.header_bottom_nav').length > 0){
     var h_height = j$("#header_container").height();
     }
     else if(j$(".header_to_shrink").length > 0) {
     var h_height = "55";
     }
     else {
     var h_height = "55";
     }
                setTimeout(function(){
     
     j$(".rd_img_carousel").trigger('updateSizes');
     j$(".rd_testimonials").trigger('updateSizes');
     j$(".partners").trigger('updateSizes');
     j$("ul").trigger('updateSizes');
     },400);
              
     
     });
    

    This should do the trick.

    Do not hesitate to contact us if you have more questions.

    Regards.