我想知道是否有办法更好地压缩此代码,这样我就不必编写所有可能的场景。任何帮助表示赞赏。
  $('select.contactselect').change(function(){
   var selectVal = $(this).val();
   if(selectVal == 'press'){
    $('.support').slideUp('fast');
    $('.general').slideUp('fast');
    $('.press').delay(100).slideDown('fast', function() {
        // Animation complete.
    });
  }else if (selectVal == 'general'){
    $('.press').slideUp('fast');
    $('.support').slideUp('fast');
    $('.general').delay(100).slideDown('fast', function() {
      // Animation complete.
    });
  }else if (selectVal == 'support'){
    $('.press').slideUp('fast');
    $('.general').slideUp('fast');
    $('.support').delay(100).slideDown('fast', function() {
      // Animation complete.
    });
  }
  });