enmi12/glossaire/_posts/demos/2011-12-22-removing.html
author ymh <ymh.work@gmail.com>
Mon, 08 Sep 2025 19:44:41 +0200
changeset 23 417f20492bf7
parent 0 d970ebf37754
permissions -rwxr-xr-x
Update Docker configuration and plugin versions - Upgrade MariaDB from 10.6 to 11 with auto-upgrade support - Add WordPress debug environment variable to FPM container - Update PHP-FPM Dockerfile base image - Update Include Mastodon Feed plugin with bug fixes and improvements - Update Portfolio plugin (v2.58) with latest translations and demo data enhancements - Remove old README.md from Mastodon Feed plugin 🤖 Generated with [Claude Code](https://claude.ai/code) Co-Authored-By: Claude <noreply@anthropic.com>

---
title: Removing
layout: default
category: demos
---

  <section id="copy">
    <p>Removing items filters them out then removes them from the page. Click on a button or the item itself to remove them.</p>
  </section>
  

  <section id="options" class="clearfix">
    
    
    <h3>Remove</h3>

    <ul id="removable" class="option-set clearfix">
      <li><a href="#remove" data-option-value=".metal">metal</a></li>
      <li><a href="#remove" data-option-value=".transition">transition</a></li>
      <li><a href="#remove" data-option-value=".post-transition">post-transition</a></li>
      <li><a href="#remove" data-option-value=".nonmetal">nonmetal</a></li>
      <li><a href="#remove" data-option-value=".alkali, .alkaline-earth">alkali and alkaline-earth</a></li>
      <li><a href="#remove" data-option-value=".metalloid">metalloid</a></li>
    </ul>

    <ul id="add-remove">
      <li><a href="#add-remove">Add / remove</a></li>
    </ul>

  </section> <!-- #options -->
  
  <div id="container" class="variable-sizes clickable clearfix">
    {% for element in site.elements limit:40 %}
      {% include element-partial.html %}
    {% endfor %}
  </div> <!-- #container -->
  
  <script src="../{{ site.jquery_js }}"></script>
  <script src="../{{ site.isotope_js }}"></script>
  <script src="../js/fake-element.js"></script>
  <script>
    $(function(){

      var $container = $('#container');

      $container.isotope({
        itemSelector : '.element'
      });

      $('#removable a').click( function( jQEvent ) {
        var selector = $(this).attr('data-option-value');
        var $removable = $container.find( selector );
        $container.isotope( 'remove', $removable );
        jQEvent.preventDefault();
      });

      $('#add-remove a').click( function( jQEvent ) {
        var $newEls = $( fakeElement.getGroup() );
        var $firstTwoElems = $container.data('isotope')
          .$filteredAtoms.filter( function( i ) {
            return i < 2;
          });

        $container
          .isotope( 'insert', $newEls )
          .isotope( 'remove', $firstTwoElems, function() {
            // console.log('items removed')
          });
        jQEvent.preventDefault();
      });

      // remove item if clicked
      $container.delegate( '.element', 'click', function(){
        $container.isotope( 'remove', $(this) );
      });

    });
  </script>