bratsun
10/18/2013 - 11:23 PM

AJAX callbacks

AJAX callbacks

$('.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');
      });
    }
  };
});
Drupal.behaviors.AjaxChecker = {
attach: function(context, settings) {  
  $('#views-exposed-form-prods-page').ajaxComplete(function(event, xhr, settings) {
	  $('.loader').hide(0);
  });
 }
}