jQuery( document ).ready( function( $ ) { const wrapper = $('.pexpo-core-comment-groups-wrapper').first(); const group = wrapper.find('.pexpo-core-comment-group').first(); let childrenCount = group.children().length; if (childrenCount > 3) { wrapper.css('animation', 'scrolling ' + group.children().length * 5 + 's linear infinite'); } });