lundi 20 mars 2017

If next section has class then add class to current section

I am trying to add a class to the current section if the next section class has the class "card_wrapper"

This is what I have but I can't seem to get it to function correctly.

  $('.main_content section').each(function(){
    if($(this).closest('section').hasClass('card_wrapper')) {
      //add class to current section (to style)
      console.log('found section');
    }
  });




Aucun commentaire:

Enregistrer un commentaire