Skip to content

Instantly share code, notes, and snippets.

@bratsun
Created October 18, 2013 23:23
Show Gist options
  • Save bratsun/7049695 to your computer and use it in GitHub Desktop.
Save bratsun/7049695 to your computer and use it in GitHub Desktop.
AJAX callbacks
Drupal.behaviors.AjaxChecker = {
attach: function(context, settings) {
$('#views-exposed-form-prods-page').ajaxComplete(function(event, xhr, settings) {
$('.loader').hide(0);
});
}
}
$('.webform-client-form').each(function() {
var t = $(this);
var id = '#' + t.attr('id');
Drupal.behaviors.webform_ajax = {
attach: function (context, settings) {
jQuery(id, context).once('webform_ajax', function () {
var top = $('.node-webform').offset().top - 10;
$('html, body').animate({
scrollTop: top
}, 500, 'easeOutQuart');
});
}
};
});
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment