title: Changing the background-color on EVERY div when on is removed
body: <p>I have a list of divs (div.row), which I need to update the background-color on. Currently I am via CSS setting the background color with div.row:nth-child(odd) and div.row:nth:child(even) ..</p>
  
  <p>The div.row's is being removed via a click - and then it succeeds, I need it to update the entire row so it still has the different background on every second..</p>
  
  <p>how can I do that?</p>
  
  <p>My script is right now:</p>
  
  <pre><code>&lt;script type="text/javascript"&gt;
  $(document).ready( function() {
      $("a.delete").click(function(){
          $.ajax({
              type: "POST",
              url: "...",
              data: { this_page_id: $(this).prev().val() },
              success: function(){
                  $(".success-delete").css("display","block");
              },
              async: false,
              dataType: "html"
          });
          $("#r" + $(this).prev().val()).slideUp();
  
          var i = 1
          $("div.row").each( function(index){
              if( i % 2 ){
                  $(this).css('background-color','#ffffff');
              } else {
                  $(this).css('background-color','#ececec');
              }
  
              i++;
          });
      });
  });
  &lt;/script&gt;
  </code></pre>