yevlakhov
4/22/2015 - 1:11 PM

MixItUp Basic Example // source http://jsbin.com/kezoba

MixItUp Basic Example

// source http://jsbin.com/kezoba

$(function () {
  $('#Grid').mixitup();
});
/*
* MIXITUP Boilerplate Template Stylesheet
*/

/* ------ DEFAULTS ------ */

html, body, div, span, applet, object, iframe, h1, h2, h3, h4, h5, h6, p, blockquote, pre, a, abbr, acronym, address, big, cite, code, del, dfn, em, img, ins, kbd, q, s, samp, small, strike, strong, sub, sup, tt, var, b, u, i, center, dl, dt, dd, ol, ul, li, fieldset, form, label, legend, table, caption, tbody, tfoot, thead, tr, th, td, article, aside, canvas, details, embed, figure, figcaption, footer, header, hgroup, menu, nav, output, ruby, section, summary, time, mark, audio, video {
margin: 0;
padding: 0;
border: 0;
vertical-align: baseline;
}
article, aside, details, figcaption, figure, footer, header, hgroup, menu, nav, section {
display: block;
}
table {
border-spacing: 0;
border-collapse: collapse;
}
h1, h2, h3, h4, h5, h6 {
font-weight: normal;
}
a {
text-decoration: none;
}
nav li {
list-style-type: none;
display: inline-block;
}
/* ------ BOILERPLATE TEMPLATE ------ */

body {
font-family: 'Open Sans';
}
.wrapper {
margin: 50px auto 0 auto;
max-width: 640px;
}
h1 {
margin-bottom: 30px;
}
h1 strong {
font-weight: 700;
}
h3 {
margin-bottom: 20px;
font-weight: 600;
}
p {
width: 500px;
margin: 0 0 30px;
text-align: left;
line-height: 1.5;
}
.controls {
display: inline-block;
width: 180px;
margin: 0 0 30px;
vertical-align: top;
}
.controls li {
margin-left: 20px;
cursor: pointer;
list-style-type: square;
}
.controls li.active {
font-weight: 700;
}
hr {
margin: 0 0 30px;
height: 0;
border: 0 none;
border-top: 1px solid #eee;
}
#Grid {
width: 640px;
text-align: justify;
font-size: 0.1px;
}
#Grid:after {
content: '';
display: inline-block;
width: 100%;
}
#Grid .mix {
display: none;
opacity: 0;
width: 200px;
height: 200px;
vertical-align: top;
margin-bottom: 20px;
background: #ccc;
color: #fff;
font-size: 30px;
text-align: center;
line-height: 200px;
}
#Grid .gap {
display: inline-block;
width: 200px;
}
<!doctype html>
<html>
<head>
	<meta charset="utf-8">
	<title>MixItUp Basic Example</title>
	<script src="http://ajax.googleapis.com/ajax/libs/jquery/1.9.1/jquery.min.js"></script>
	<script src="http://www.jqueryscript.net/demo/jQuery-Plugin-For-Filtering-Sorting-Html-Elements-MixItUp/jquery.mixitup.min.js"></script>
<style id="jsbin-css">
/*
* MIXITUP Boilerplate Template Stylesheet
*/

/* ------ DEFAULTS ------ */

html, body, div, span, applet, object, iframe, h1, h2, h3, h4, h5, h6, p, blockquote, pre, a, abbr, acronym, address, big, cite, code, del, dfn, em, img, ins, kbd, q, s, samp, small, strike, strong, sub, sup, tt, var, b, u, i, center, dl, dt, dd, ol, ul, li, fieldset, form, label, legend, table, caption, tbody, tfoot, thead, tr, th, td, article, aside, canvas, details, embed, figure, figcaption, footer, header, hgroup, menu, nav, output, ruby, section, summary, time, mark, audio, video {
margin: 0;
padding: 0;
border: 0;
vertical-align: baseline;
}
article, aside, details, figcaption, figure, footer, header, hgroup, menu, nav, section {
display: block;
}
table {
border-spacing: 0;
border-collapse: collapse;
}
h1, h2, h3, h4, h5, h6 {
font-weight: normal;
}
a {
text-decoration: none;
}
nav li {
list-style-type: none;
display: inline-block;
}
/* ------ BOILERPLATE TEMPLATE ------ */

body {
font-family: 'Open Sans';
}
.wrapper {
margin: 50px auto 0 auto;
max-width: 640px;
}
h1 {
margin-bottom: 30px;
}
h1 strong {
font-weight: 700;
}
h3 {
margin-bottom: 20px;
font-weight: 600;
}
p {
width: 500px;
margin: 0 0 30px;
text-align: left;
line-height: 1.5;
}
.controls {
display: inline-block;
width: 180px;
margin: 0 0 30px;
vertical-align: top;
}
.controls li {
margin-left: 20px;
cursor: pointer;
list-style-type: square;
}
.controls li.active {
font-weight: 700;
}
hr {
margin: 0 0 30px;
height: 0;
border: 0 none;
border-top: 1px solid #eee;
}
#Grid {
width: 640px;
text-align: justify;
font-size: 0.1px;
}
#Grid:after {
content: '';
display: inline-block;
width: 100%;
}
#Grid .mix {
display: none;
opacity: 0;
width: 200px;
height: 200px;
vertical-align: top;
margin-bottom: 20px;
background: #ccc;
color: #fff;
font-size: 30px;
text-align: center;
line-height: 200px;
}
#Grid .gap {
display: inline-block;
width: 200px;
}
</style>
</head>

<body>

<div class="wrapper" style="margin-top:150px;">

	<!-- FILTER CONTROLS -->

	<div class="controls">
		<h3>Filter Controls</h3>
		<ul>
			<li class="filter" data-filter="all">Show All</li>
			<li class="filter" data-filter="category_1">Category 1</li>
			<li class="filter" data-filter="category_2">Category 2</li>
			<li class="filter" data-filter="category_3">Category 3</li>
			<li class="filter" data-filter="category_3 category_1">Category 1 &amp; 3</li>
		</ul>
	</div>

	<!-- SORT CONTROLS -->

	<div class="controls">
		<h3>Sort Controls</h3>
		<ul>
			<li class="sort" data-sort="data-cat" data-order="desc">Descending</li>
			<li class="sort" data-sort="data-cat" data-order="asc">Ascending</li>
			<li class="sort" data-sort="default" data-order="desc">Default</li>
		</ul>
	</div>
	<hr/>

	<!-- GRID -->

	<ul id="Grid">
		<li class="mix category_1" data-cat="1">1</li>
		<li class="mix category_3" data-cat="3">3</li>
		<li class="mix category_2" data-cat="2">2</li>
		<li class="mix category_3" data-cat="3">3</li>
		<li class="mix category_2" data-cat="2">2</li>
		<li class="mix category_1" data-cat="1">1</li>
		<li class="gap"></li>
		<!-- "gap" elements fill in the gaps in justified grid -->
	</ul>
</div>

<script id="jsbin-javascript">
$(function () {
  $('#Grid').mixitup();
});
</script>

<script id="jsbin-source-html" type="text/html"><!doctype html>
<html>
<head>
	<meta charset="utf-8">
	<title>MixItUp Basic Example</title>
	<script src="http://ajax.googleapis.com/ajax/libs/jquery/1.9.1/jquery.min.js"><\/script>
	<script src="http://www.jqueryscript.net/demo/jQuery-Plugin-For-Filtering-Sorting-Html-Elements-MixItUp/jquery.mixitup.min.js"><\/script>
</head>

<body>

<div class="wrapper" style="margin-top:150px;">

	<\!-- FILTER CONTROLS -->

	<div class="controls">
		<h3>Filter Controls</h3>
		<ul>
			<li class="filter" data-filter="all">Show All</li>
			<li class="filter" data-filter="category_1">Category 1</li>
			<li class="filter" data-filter="category_2">Category 2</li>
			<li class="filter" data-filter="category_3">Category 3</li>
			<li class="filter" data-filter="category_3 category_1">Category 1 &amp; 3</li>
		</ul>
	</div>

	<\!-- SORT CONTROLS -->

	<div class="controls">
		<h3>Sort Controls</h3>
		<ul>
			<li class="sort" data-sort="data-cat" data-order="desc">Descending</li>
			<li class="sort" data-sort="data-cat" data-order="asc">Ascending</li>
			<li class="sort" data-sort="default" data-order="desc">Default</li>
		</ul>
	</div>
	<hr/>

	<\!-- GRID -->

	<ul id="Grid">
		<li class="mix category_1" data-cat="1">1</li>
		<li class="mix category_3" data-cat="3">3</li>
		<li class="mix category_2" data-cat="2">2</li>
		<li class="mix category_3" data-cat="3">3</li>
		<li class="mix category_2" data-cat="2">2</li>
		<li class="mix category_1" data-cat="1">1</li>
		<li class="gap"></li>
		<\!-- "gap" elements fill in the gaps in justified grid -->
	</ul>
</div>

</body>
</html>

</script>

<script id="jsbin-source-css" type="text/css">/*
* MIXITUP Boilerplate Template Stylesheet
*/

/* ------ DEFAULTS ------ */

html, body, div, span, applet, object, iframe, h1, h2, h3, h4, h5, h6, p, blockquote, pre, a, abbr, acronym, address, big, cite, code, del, dfn, em, img, ins, kbd, q, s, samp, small, strike, strong, sub, sup, tt, var, b, u, i, center, dl, dt, dd, ol, ul, li, fieldset, form, label, legend, table, caption, tbody, tfoot, thead, tr, th, td, article, aside, canvas, details, embed, figure, figcaption, footer, header, hgroup, menu, nav, output, ruby, section, summary, time, mark, audio, video {
margin: 0;
padding: 0;
border: 0;
vertical-align: baseline;
}
article, aside, details, figcaption, figure, footer, header, hgroup, menu, nav, section {
display: block;
}
table {
border-spacing: 0;
border-collapse: collapse;
}
h1, h2, h3, h4, h5, h6 {
font-weight: normal;
}
a {
text-decoration: none;
}
nav li {
list-style-type: none;
display: inline-block;
}
/* ------ BOILERPLATE TEMPLATE ------ */

body {
font-family: 'Open Sans';
}
.wrapper {
margin: 50px auto 0 auto;
max-width: 640px;
}
h1 {
margin-bottom: 30px;
}
h1 strong {
font-weight: 700;
}
h3 {
margin-bottom: 20px;
font-weight: 600;
}
p {
width: 500px;
margin: 0 0 30px;
text-align: left;
line-height: 1.5;
}
.controls {
display: inline-block;
width: 180px;
margin: 0 0 30px;
vertical-align: top;
}
.controls li {
margin-left: 20px;
cursor: pointer;
list-style-type: square;
}
.controls li.active {
font-weight: 700;
}
hr {
margin: 0 0 30px;
height: 0;
border: 0 none;
border-top: 1px solid #eee;
}
#Grid {
width: 640px;
text-align: justify;
font-size: 0.1px;
}
#Grid:after {
content: '';
display: inline-block;
width: 100%;
}
#Grid .mix {
display: none;
opacity: 0;
width: 200px;
height: 200px;
vertical-align: top;
margin-bottom: 20px;
background: #ccc;
color: #fff;
font-size: 30px;
text-align: center;
line-height: 200px;
}
#Grid .gap {
display: inline-block;
width: 200px;
}
</script>

<script id="jsbin-source-javascript" type="text/javascript">$(function () {
  $('#Grid').mixitup();
});</script></body>
</html>