jQuery(function ($) { //accordion $('#open-accordion-1 a').on('click', function(event){ $('#my-accordion .et_pb_accordion_item_1 .et_pb_toggle_title').click(); open-accordion-2 a').on('click', function(event){ $('#my-accordion .et_pb_accordion_item_2 .et_pb_toggle_title').click(); $("html, body").animate({ scrollTop: $('#my-accordion').offset().top }, 1000); });