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.

+ add another resource

You're using npm packages, so we've auto-selected Babel for you here, which we require to process imports and make it all work. If you need to use a different JavaScript preprocessor, remove the packages in the npm tab.

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

Use npm Packages

We can make npm packages available for you to use in your JavaScript. We use webpack to prepare them and make them available to import. We'll also process your JavaScript with Babel.

⚠️ This feature can only be used by logged in users.

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.

HTML Settings

Here you can Sed posuere consectetur est at lobortis. Donec ullamcorper nulla non metus auctor fringilla. Maecenas sed diam eget risus varius blandit sit amet non magna. Donec id elit non mi porta gravida at eget metus. Praesent commodo cursus magna, vel scelerisque nisl consectetur et.

            
              <div class="main-content-wrap">
	
	<div class="bed-selection content-full decor">

		<header class="selector-hero">
			<h1>Bed Collection</h1>
      <p>Lorem ipsum etc</p>
		</header>

			<form class="controls" id="Filters">

				<h2>Use our filters to find your perfect bed</h2>

				<fieldset>
					<button class="filter" data-filter=".single">Single beds</button>
	<button class="filter" data-filter=".double">Double beds</button>
</fieldset>

 <fieldset>
	<button id="jtex" class="filter" data-filter=".jtex">J-Tex&trade; Sprung Base</button>
	<button class="filter" data-filter=".slats">Traditional Slatted</button>
	<button class="Reset">Show all beds</button>
				</fieldset>
			</form>

		<div id="Container" class="container effects">

			<div class="mix single jtex value-airflow" data-myorder="1">
				<h2>J-Tex&trade; Sprung Base</h2>
				<img src="http://www.jaybe.com/_images/bed-selector/value-airflow.jpg" alt="Value Folding Bed with Airlfow Fibre Mattress 2ft 3in">
				
				<div class="overlay">
					<a class="expand" href="/folding-beds/value-airflow">View in detail</a>
				</div>
				<h3>Value Airflow Fibre <span>(2ft 3in)</span></h3>
			</div>

			<div class="mix double jtex value-airflow" data-myorder="2">
				<h2>J-Tex&trade; Sprung Base</h2>
				<img src="http://www.jaybe.com/_images/bed-selector/value-airflow-double.jpg" alt="Value Folding Bed with Airlfow Fibre Mattress 4ft">
				
				<div class="overlay">
					<a class="expand" href="/folding-beds/value-airflow-double">View in detail</a>
				</div>
				<h3>Value Airflow Fibre <span>(4ft)</span></h3>
			</div>

			<div class="mix single jtex value-memory" data-myorder="3">
				<h2>J-Tex&trade; Sprung Base</h2>
				<img src="http://www.jaybe.com/_images/bed-selector/value-memory.jpg" alt="Value Folding Bed with Memory Foam Mattress 2ft 3in">
				
				<div class="overlay">
					<a class="expand" href="/folding-beds/value-memory">View in detail</a>
				</div>
				<h3>Value Memory Foam <span>(2ft 3in)</span></h3>
			</div>

			<div class="mix double jtex value-memory" data-myorder="4">
				<h2>J-Tex&trade; Sprung Base</h2>
				<img src="http://www.jaybe.com/_images/bed-selector/value-memory-double.jpg" alt="Value Folding Bed with Memory Foam Mattress 4ft">
				
				<div class="overlay">
					<a class="expand" href="/folding-beds/value-memory-double">View in detail</a>
				</div>
				<h3>Value Memory Foam <span>(4ft)</span></h3>
			</div>

			<div class="mix single jtex advance" data-myorder="5">
				<h2>J-Tex&trade; Sprung Base</h2>
				<img src="http://www.jaybe.com/_images/bed-selector/advance.jpg" alt="Advance Folding Bed with Airflow Fibre Mattress 2ft 6in">
				
				<div class="overlay">
					<a class="expand" href="/folding-beds/advance">View in detail</a>
				</div>
				<h3>Advance Airflow Fibre <span>(2ft 6in)</span></h3>
			</div>

			<div class="mix single slats jubilee" data-myorder="6">
				<h2>Sprung Slatted Base</h2>
				<img src="http://www.jaybe.com/_images/bed-selector/jubilee.jpg" alt="Jubilee Folding Bed with Airflow Fibre Mattress 2ft 6in">
				
				<div class="overlay">
					<a class="expand" href="/folding-beds/jubilee">View in detail</a>
				</div>
				<h3>Jubilee Airflow Fibre <span>(2ft 6in)</span></h3>
			</div>

			<div class="mix double slats jubilee" data-myorder="7">
				<h2>Sprung Slatted Base</h2>
				<img src="http://www.jaybe.com/_images/bed-selector/jubilee-double.jpg" alt="Jubilee Folding Bed with Airflow Fibre Mattress 4ft">
				
				<div class="overlay">
					<a class="expand" href="/folding-beds/jubilee-double">View in detail</a>
				</div>
				<h3>Jubilee Airflow Fibre <span>(4ft)</span></h3>
			</div>

			<div class="mix single slats kingston" data-myorder="8">
				<h2>Sprung Slatted Base</h2>
				<img src="http://www.jaybe.com/_images/bed-selector/kingston.jpg" alt="Kingston Folding Bed with Contract Mattress 2ft 6in">
				
				<div class="overlay">
					<a class="expand" href="/folding-beds/kingston">View in detail</a>
				</div>
				<h3>Kingston Contract <span>(2ft 6in)</span></h3>
			</div>

			<div class="mix single slats royal" data-myorder="9">
				<h2>Sprung Slatted Base</h2>
				<img src="http://www.jaybe.com/_images/bed-selector/royal.jpg" alt="Royal Folding Bed with Pocket Sprung Mattress 2ft 6in">
				
				<div class="overlay">
					<a class="expand" href="/folding-beds/royal">View in detail</a>
				</div>
				<h3>Royal Pocket Sprung <span>(2ft 6in)</span></h3>
			</div>

			<div class="mix double slats royal" data-myorder="10">
				<h2>Sprung Slatted Base</h2>
				<img src="http://www.jaybe.com/_images/bed-selector/royal-double.jpg" alt="Royal Folding Bed with Pocket Sprung Mattress 4ft">
				
				<div class="overlay">
					<a class="expand" href="/folding-beds/royal-double">View in detail</a>
				</div>
				<h3>Royal Pocket Sprung <span>(4ft)</span></h3>
			</div>

			<div class="gap"></div>
        	<div class="gap"></div>

		</div><!-- Container -->

		<div class="clear-fix"></div>
		
	</div><!-- prod-selection -->
	
</div><!-- main-content-wrap -->
            
          
!
            
              /*Loaded externally*/
            
          
!
            
              var buttonFilter = {

  $filters: null,
  $reset: null,
  groups: [],
  outputArray: [],
  outputString: '',

  init: function(){
    var self = this;

    self.$filters = $('#Filters');
    self.$reset = $('#Reset');
    self.$container = $('#Container');

    self.$filters.find('fieldset').each(function(){
      self.groups.push({
        $buttons: $(this).find('.filter'),
        active: ''
      });
    });

    self.bindHandlers();
  },

  bindHandlers: function(){
    var self = this;

    self.$filters.on('click', '.filter', function(e){
      e.preventDefault();

      var $button = $(this);

      $button.hasClass('active') ?
        $button.removeClass('active') :
        $button.addClass('active').siblings('.filter').removeClass('active');

      self.parseFilters();
    });

    // Handle reset click

    self.$reset.on('click', function(e){
      e.preventDefault();

      self.$filters.find('.filter').removeClass('active');

      self.parseFilters();
    });
  },

  parseFilters: function(){
    var self = this;

    for(var i = 0, group; group = self.groups[i]; i++){
      group.active = group.$buttons.filter('.active').attr('data-filter') || '';
    }

    self.concatenate();
  },

  concatenate: function(){
    var self = this;

    self.outputString = '';

    for(var i = 0, group; group = self.groups[i]; i++){
      self.outputString += group.active;
    }

    !self.outputString.length && (self.outputString = 'all');

    console.log(self.outputString);


	  if(self.$container.mixItUp('isLoaded')){
    	self.$container.mixItUp('filter', self.outputString);
	  }
  }
};

// On document ready

$(function(){

  buttonFilter.init();

  $('#Container').mixItUp({
    controls: {
      enable: false
    },
    load: {
      filter: '.single, .double'
    },
    callbacks: {
      onMixFail: function(){
        alert('No beds were found matching the selected filters.');
      }
    }
  });

// Code for Overlay
if (Modernizr.touch) {
  
        // If we have a touch screen
      $(".mix").click(function(e){
            $(".mix").removeClass("hover");
            $(this).addClass("hover");
        });
  
      } else { 
 
     // If we are using a mouse
     $(".mix").mouseenter(function(){
            $(this).addClass("hover");
        })

        .mouseleave(function(){
            $(this).removeClass("hover");
        });
            
      }

});


            
          
!
999px
🕑 One or more of the npm packages you are using needs to be built. You're the first person to ever need it! We're building it right now and your preview will start updating again when it's ready.

Console