cssAudio - Activefile-genericCSS - ActiveGeneric - ActiveHTML - ActiveImage - ActiveJS - ActiveSVG - ActiveText - Activefile-genericVideo - ActiveLovehtmlicon-new-collectionicon-personicon-teamlog-outoctocatpop-outspinnerstartv

Pen Settings

CSS Base

Vendor Prefixing

Add External Stylesheets/Pens

Any URL's added here will be added as <link>s in order, and before the CSS in the editor. If you link to another Pen, it will include the CSS from that Pen. If the preprocessor matches, it will attempt to combine them before processing.

Quick-add: + add another resource

Add External Scripts/Pens

Any URL's added here will be added as <script>s in order, and run before the JavaScript in the editor. You can use the URL of any other Pen and it will include the JavaScript from that Pen.

Quick-add: + add another resource

Code Indentation

     

Save Automatically?

If active, Pens will autosave every 30 seconds after being saved once.

Auto-Updating Preview

If enabled, the preview panel updates automatically as you code. If disabled, use the "Run" button to update.

            
              <section class="container">
  <h1>Ограничить сектор поиска по организациям</h1>
  <p><span id="label">Без ограничений</span>:</p>
  <input id="party" name="party" type="text" />
  <p>Выберите ограничение поиска:</p>
  <ul id="switcher">
    <li><a href="#none" data-switch="none">Без ограничений</a></li>
    <li><a href="#area" data-switch="area">Поиск по Москве</a></li>
    <li><a href="#type_legal" data-switch="type_legal">Только компании</a></li>
    <li><a href="#type_ip" data-switch="type_ip">Только ИП</a></li>
    <li><a href="#status_actual" data-switch="status_actual">Только действующие</a></li>
    <li><a href="#status_liquidated" data-switch="status_liquidated">Только ликвидированные</a></li>
  </ul>
</section>
            
          
!
            
              input {
  font-size: 16px;
  padding: 4px;
}
#switcher a {
  text-decoration: none;
  border-bottom: 1px dotted blue;
}
#switcher a:hover {
  border-bottom: none;
}
#switcher li {
  line-height: 1.5
}

            
          
!
            
              var TOKEN = "5ef98f5781a106962077fb18109095f9f11ebac1";

function none() {
  $("#label").text("Без ограничений");
  $("#party").suggestions({
    token: TOKEN,
    type: "PARTY"
  });
};

function area() {
  $("#label").text("Поиск по Москве");
  $("#party").suggestions({
    token: TOKEN,
    type: "PARTY",
    constraints: {
      locations: { "kladr_id": "77" },
    }
  });
};

function type_legal() {
  $("#label").text("Поиск среди компаний");
  $("#party").suggestions({
    token: TOKEN,
    type: "PARTY",
    params: {
      type: "LEGAL"
    }
  });
};

function type_ip() {
  $("#label").text("Поиск среди ИП");
  $("#party").suggestions({
    token: TOKEN,
    type: "PARTY",
    params: {
      type: "INDIVIDUAL"
    }
  });
};

function status_actual() {
  $("#label").text("Поиск среди действующих организаций");
  $("#party").suggestions({
    token: TOKEN,
    type: "PARTY",
    params: {
      status:  ["ACTIVE"]
    }
  });
};

function status_liquidated() {
  $("#label").text("Поиск среди ликвидированных организаций");
  $("#party").suggestions({
    token: TOKEN,
    type: "PARTY",
    params: {
      status:  ["LIQUIDATED"]
    }
  });
};

$("#switcher a").click(function(e) {
  e.preventDefault();
  $("#party").val("");
  var fnName = $(this).data("switch");
  window[fnName]();
});

none();
            
          
!
999px
Loading ..................

Console