').text(jQuery(this).attr('alt')); }); (function($) { $(document).on('click', 'a[href^="#"]', function(e) { var id = $(this).attr('href'); var $id = $(id); if ($id.length === 0) { return; } e.preventDefault(); var pos = $id.offset().top; $('body, html').animate({scrollTop: pos},800); $( "body.open-menu #overlay-menu .menu-icon" ).trigger( "click" ); }); })(jQuery); } // call custom javascript smp_custom_js(); // call it again for every page change window.addEventListener("sempliceAppendContent", function (e) { smp_custom_js(); }, false);