Pen Settings

HTML

CSS

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.

+ add another resource

JavaScript

Babel includes JSX processing.

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.

+ add another resource

Packages

Add Packages

Search for and use JavaScript packages from npm here. By selecting a package, an import statement will be added to the top of the JavaScript editor for this package.

Behavior

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.

Format on Save

If enabled, your code will be formatted when you actively save your Pen. Note: your code becomes un-folded during formatting.

Editor Settings

Code Indentation

Want to change your Syntax Highlighting theme, Fonts and more?

Visit your global Editor Settings.

HTML

              
                <div class="page1">
  Страница1
  <div><a href="/filter?filter=f1">Фильтр1</a></div>
  <div><a href="/filter?filter=f2">Фильтр2</a></div>
</div>

<div class="page2">
  Страница2
  <div><a href="/filter?filter=f3">Фильтр3</a></div>
  <div><a href="/filter?filter=f4">Фильтр4</a></div>
</div>

<div class="filterblock">
PAGE FILTER

  <?php

$style = isset($_GET['filter']) ? $_GET['filter'] : '';
?> 
  
<select id="filterSelect">
		<option value="*">Все</option>
		<option value="f1">Фильтр1</option>
		<option value="f2">Фильтр2</option>
		<option value="f3">Фильтр3</option>
    <option value="f4">Фильтр4</option>
	</select>
	<div class="f1 filterElement">Элемент1</div>
	<div class="f2 filterElement">Элемент2</div>
  <div class="f3 filterElement">Элемент3</div>
  <div class="f4 filterElement">Элемент4</div>
</div>
              
            
!

CSS

              
                .filterblock{
  float: right;
}

.page1, page2{
  float: left;
  margin: 0 100px;
}
              
            
!

JS

              
                function filterDiv(){
      $("#filterSelect")
      var showClass=$("#filterSelect option:selected").val();
      if (showClass=="*")
        {
          $(".filterElement").show();
        }
      else
      {
        $(".filterElement").hide();
        $("."+showClass).show();
      }
    }
$(document).ready(function(){
    filterDiv(); // Подразумеваем, что нужный option уже выбран и нам надо просто после загрузки страницы отфильтровать элементы.
    $("#filterSelect").change(function(){filterDiv()}); // эта же функция "вешается" на onChange.
});
              
            
!
999px

Console