1

Есть select по которому выезжает или 1 или 2 блок:

$(document).ready(function() {
  $('#pc').hide();
  $('#mob').hide();
  $("#guide").change(function() {
    $('#pc').hide(300);
    $('#mob').hide(300);
    $("#" + this.value).show(600);
  });
});
<script src="https://ajax.googleapis.com/ajax/libs/jquery/2.1.1/jquery.min.js"></script>
<select id="guide">
  <option value="" selected>Please choise you device</option>
  <option value="pc">PC or MAC</option>
  <option value="mob">iOs and Android Device</option>
</select>
<div id="pc">Partizan Security is European brand created in 2008. Due to the team of high-class developers and constant intrusion of innovations, company holds leading position on the market of video surveillance systems and security. Own offices and representatives are concentrated in 10 countries of Europe, Asia and Middle East, and its production is successfully used in more than 60 countries of the world.</div>
<div id="mob">Partizan does not follow market trends, but predetermines the way of its evolution. Therefore special attention is paid to research and development of innovative products. Under the Partizan brand we create modern solutions for AHD video surveillance, IP video surveillance and access control. Moreover, Partizan development team create their own software to work with video surveillance and access control systems. Partizan Cloud is a unique offer, it’s the world’s first complete solution for video cloud storage from CCTV manufacturer.</div>

Но блоки разворачиваются и сворачиваются по диагонали. Как сделать разворачивание сверху вниз?

2

1 ответ 1

1

Можно $("#" + this.value).show(600); заменить на $("#" + this.value).slideToggle(600);

$(document).ready(function() {
  $('#pc').hide();
  $('#mob').hide();
  $("#guide").change(function() {
    $('#pc').hide(300);
    $('#mob').hide(300);
    $("#" + this.value).slideToggle(600);
  });
});
<script src="https://ajax.googleapis.com/ajax/libs/jquery/2.1.1/jquery.min.js"></script>
<select id="guide">
  <option value="" selected>Please choise you device</option>
  <option value="pc">PC or MAC</option>
  <option value="mob">iOs and Android Device</option>
</select>
<div id="pc">Partizan Security is European brand created in 2008. Due to the team of high-class developers and constant intrusion of innovations, company holds leading position on the market of video surveillance systems and security. Own offices and representatives are concentrated in 10 countries of Europe, Asia and Middle East, and its production is successfully used in more than 60 countries of the world.</div>
<div id="mob">Partizan does not follow market trends, but predetermines the way of its evolution. Therefore special attention is paid to research and development of innovative products. Under the Partizan brand we create modern solutions for AHD video surveillance, IP video surveillance and access control. Moreover, Partizan development team create their own software to work with video surveillance and access control systems. Partizan Cloud is a unique offer, it’s the world’s first complete solution for video cloud storage from CCTV manufacturer.</div>

Ваш ответ

By clicking “Отправить ответ”, you agree to our terms of service and acknowledge you have read our privacy policy.

Всё ещё ищете ответ? Посмотрите другие вопросы с метками или задайте свой вопрос.