如何使用嵌套div隐藏div

时间:2016-05-27 14:50:31

标签: javascript jquery html css

我是Javascript(和JQuery)和Web开发本身的新手,所以当我选择一个选项时,我在尝试显示div service_info的整个内容时遇到了问题(隐藏了)在我的<select>中,ID为service_type

以下是代码,使用在head标记中声明的materialize.css和MDL。在MDL和实现脚本之前的head标记中声明了jQuery 2.2.1。

&#13;
&#13;
$('#service_type').change(function() {
  $('#service_info').show('slide');
});
&#13;
<script src="https://ajax.googleapis.com/ajax/libs/jquery/2.1.1/jquery.min.js"></script>
<div class="row">
  <div class="input-field col s12">
    <select id="service_type" name="service_type">
      <option disabled selected value="">
          Scegli un tipo di servizio
      </option>
      <option value="discharge">
          Dimissioni
      </option>
      <option value="transfer">
          Trasfermimento struttura
      </option>
      <option value="examination">
          Visita di controllo
      </option>
      <option value="admission">
          Ricovero in casa di cura o clinica
      </option>
    </select>
  </div>
</div>
<div class="col s12" id="service_info" hidden>
  <div class="row">
    <div class="input-field col s4">
      <input class="mdl-textfield__input" id="place_from" name="place_from" type="text">
      <label for="place_from">Indirizzo del luogo di partenza</label>
    </div>
    <div class="input-field col s4">
      <input class="validate" id="place_to" name="place_to" type="text">
      <label for="place_to">Indirizzo del luogo di arrivo</label>
    </div>
    <div class="input-field col s4">
      <input class="validate" id="section" name="section" type="text">
      <label for="section">Reparto</label>
    </div>
  </div>
</div>
&#13;
&#13;
&#13;

我无法理解为什么似乎没有发生任何事情。

1 个答案:

答案 0 :(得分:0)

###BAD QUERY STRING BLOCKER, ADDED 5/26/2016
<IfModule mod_rewrite.c>
RewriteCond %{QUERY_STRING} ^[\-/A-Z0-9]+$ [NC]
RewriteRule (.*) - [R=404]
</IfModule>
###END CODE