To start with, my goal was to alter the ajax loading behavior in views exposed filter (Druapl 7 and Views 7.x-3.3) and this question pretty much sorted that one out: How do I change the ajax loading behaviour in Views?
Here comes the problem, the jQuery .ajaxStart and .ajaxSuccess doesn't seem to fire when i change the exposed filter in the view. I get my custom.js file to load correctly and this simple code works just fine:
(function($) {
Drupal.behaviors.seven_doublemthemes = {
attach: function(context, settings) {
alert('message');
}
};
})(jQuery);
but replacing my alert message with this does not:
$('#views-exposed-form-produkter-3-kol-page', context).ajaxStart(function(){
$('#views-exposed-form-produkter-3-kol-page,div.view-id-produkter_3_kol', context).fadeTo(300, 0.5);
});
$('#views-exposed-form-produkter-3-kol-page', context).ajaxSuccess(function(){
$('#views-exposed-form-produkter-3-kol-page', context).fadeTo(300, 1.0);
$('div.view-id-produkter_3_kol', context).css('opacity', 0.5).fadeTo(300, 1.0);
});
I have also tried to use $(document).ajaxStart without success. The fading also works if i remove the ajaxStart and allow it to fade when page is loaded.
So, if i could get the ajaxStart and Success to fire, everything else should work like I wanted it.
(This is my first question here, so I hope I've managed to do it the right way)