title: if .parent() .hasclass then do not apply the function
body: <p>I have this function which should be called only when parent doesn't have the class <code>cooling</code>.</p>
  
  <pre><code>function inputWidth() {
          $('input[disabled="disabled"]').removeAttr("disabled").prop("readonly", true);
          $('input[type!="submit"]').focus(function(){
              if ($(this).val().length &gt; 20) {
                  $(this).attr('data-default', $(this).width());
                  $(this).animate({
                      width: 350
                  }, 'slow');
                  $(this).parent().addClass('cooling');
              }
          }).blur(function(){ /* lookup the original width */
              var w = $(this).attr('data-default');
              $(this).animate({
                  width: w
              }, 'fast');
              $(this).parent().removeClass('cooling');
          });
     };
  </code></pre>