Views AJAX Submit is removing my custom classes I have custom jQuery that I've added to views filters to my ajax view. When a user selects certain criteria a slideDown and addClass event is triggered and a new set of filters is shown. You can view it here:

https://www.feedingmatters.org/helpful-books

When I click submit the classes that are added to my elements are removed by Drupal. This causes the elements to display: none and now the users can no longer see their filter trail. How can I either stop Drupal from clearing my addClass? The filters need to remain visible so long as the correct criteria are selected.

Note: I tried views dependent filters but it doesn't work as needed.
I struggled with this recently in this question

The answer is to wrap your jQuery in a Drupal Behaviour so that the classes are not removed on every ajax request. Because your current jQuery is probably only run on the first page load.

(function($) {
Drupal.behaviors.myBehavior = {
  attach: function (context, settings) {

        // Put your jQuery Code Here

  }
};
})(jQuery);