JSFiddle - React, Tailwind, and code Playground

HTML

<script src="http://code.jquery.com/jquery-2.0.3.min.js"></script>
  
    

<div id="testDiv">foo</div>

<div id="testDiv2">foo</div>

CSS

DIV#testDiv2 {
    z-index: 1;
    background-color:#f00;
    width:100px;
}

DIV#testDiv {
z-index: 1;
background-color:#f00;
width:100px;
}

JavaScript

setTimeout( function() {
      
    $('DIV#testDiv').animate({'width':'+=4'});
    $('DIV#testDiv2').animate({'z-index':'+=4'}, function() {
        $('DIV#testDiv2').text($('DIV#testDiv2').css('z-index'));
    });
      
    }, 3000);
    
    setTimeout( function() {
      
      $('DIV#testDiv').animate({'width':'-=4'});
      $('DIV#testDiv2').animate({'z-index':'-=4'}, function() {
          $('DIV#testDiv2').text($('DIV#testDiv2').css('z-index'));
      });
      
    }, 7000);