title: jquery optimize ,repeated use of this
body: <p>I am using the same variables for mouseover and mouseout,is there any way to shorten this?</p>
  
  <p><div class="snippet" data-lang="js" data-hide="false" data-console="true" data-babel="false">
  <div class="snippet-code">
  <pre class="snippet-code-js lang-js prettyprint-override"><code>$('#service_tab li').on('mouseover', function() {
  
    var $a = $(this).find("a"),
      dt = $a.attr("href");
    $(dt).addClass('tabv');
    $("#tabs-1").addClass('tabh');
  
  });
  
  $('#service_tab li').on('mouseout', function() {
    var $a = $(this).find("a"),
      dt = $a.attr("href");
    $(dt).removeClass('tabv');
    $("#tabs-1").removeClass('tabh');
  });</code></pre>
  </div>
  </div>
  </p>