(function ($, Drupal, settings) { $(window).on('scroll', function () { if ($('.scroll-to-top').length) { var strickyScrollPos = 65; if ($(window).scrollTop() > strickyScrollPos) { $('.scroll-to-top').fadeIn(500); } else if ($(this).scrollTop() <= strickyScrollPos) { $('.scroll-to-top').fadeOut(500); } } }); if ($('.scroll-to-target').length) { $(".scroll-to-target").on('click', function () { var target = $(this).attr('data-target'); $('html, body').animate({ scrollTop: $(target).offset().top }, 1000); return false; }); Drupal.behaviors.page_widget = { attach: function (context) { $('.js-webform-confirmation-modal', context).once('webform-confirmation-modal').each(function () { $('.form-confirm-model').fadeIn(); $('.form-confirm-model .close-conrim-model').click(function () { $('.form-confirm-model').fadeOut(); }) }) } } } })(jQuery, Drupal, drupalSettings);