sander
sander

Reputation: 1581

Jquery error too much recursion multiple onclick events

I am searching on Google and on stackoverflow for the error: too much recursion that i have with this script. But i don't found a solution. I try with event.stopPropagation(); but don't work for me in this script. URL/page where script is running: https://webdesignrebry.be/step/verloop/ I am using wordpress. On the page you have a href link and links in submenu that switch to the divi tabs in the left side. Can anybody help me? Thanks!

(function($){
    $('.voorbereiding').on('click', function(event){
        $('.ds-tab-cube .et_pb_tab_0 a').click();
    }); 
    $('.ontwikkeling').on('click', function(event){
        $('.ds-tab-cube .et_pb_tab_1 a').click();
    }); 
    $('.peiling').on('click', function(event){
        $('.ds-tab-cube .et_pb_tab_2 a').click();
    }); 
})(jQuery);

(function($){
    $('.valorisatie').on('click', function(event){
        $('.ds-tab-cube .et_pb_tab_3 a').click(); 
    }); 
})(jQuery);

Upvotes: 0

Views: 138

Answers (1)

Jinesh
Jinesh

Reputation: 1580

Please use this code

  (jQuery);
        (function($){

        $('.voorbereiding').on('click', function(event){

     $('.et_pb_tabs_controls .et_pb_tab_0 a').click();
        }); 

        $('.ontwikkeling').on('click', function(event){

     $('.et_pb_tabs_controls .et_pb_tab_1 a').click();
        }); 

        $('.peiling').on('click', function(event){

     $('.ds-tab-cube .et_pb_tab_2 a').click();
        }); 
        })(jQuery);
        (function($){

        $('.valorisatie').on('click', function(event){
     $('.et_pb_tabs_controls .et_pb_tab_3 a').click();
     });    
    })(jQuery);

Use above code in this javascript file :- https://webdesignrebry.be/step/wp-content/themes/Divi-Ultimate/js/custom-js.js

Upvotes: 1

Related Questions