"gallery filters"
Bootstrap 3.0.0 Snippet by evarevirus

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
<link href="//netdna.bootstrapcdn.com/bootstrap/3.0.0/css/bootstrap.min.css" rel="stylesheet" id="bootstrap-css">
<script src="//netdna.bootstrapcdn.com/bootstrap/3.0.0/js/bootstrap.min.js"></script>
<script src="//code.jquery.com/jquery-1.11.1.min.js"></script>
<!------ Include the above in your HEAD tag ---------->
<div class="work">
<div class="category-buttons">
<a href="#" class="active all" data-group="all">All</a>
<a href="#" data-group="city">city</a>
<a href="#" data-group="nature">nature</a>
<a href="#" data-group="food">food</a>
<a href="#" data-group="sports">sports</a>
<a href="#" data-group="people">people</a>
</div>
<div id="grid" class="grid">
<a class="card" href="#" data-groups="city,">
<img src="http://lorempixel.com/200/150/city" />
<div class="title">Project Title test me more please do this for me please dood.</div>
</a>
<a class="card" href="#" data-groups="nature,">
<img src="http://lorempixel.com/200/150/nature" />
<div class="title">Project Title</div>
</a>
<a class="card" href="#" data-groups="food,">
<img src="http://lorempixel.com/200/150/food" />
<div class="title">Project Title</div>
</a>
<a class="card" href="#" data-groups="sports,people,">
<img src="http://lorempixel.com/200/150/sports" />
<div class="title">Project Title</div>
</a>
<a class="card" href="#" data-groups="people,food,">
<img src="http://lorempixel.com/200/150/people" />
<div class="title">Project Title</div>
</a>
<a class="card" href="#" data-groups="city,people,">
XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
.work {
padding-bottom: 40px;
margin-top: 60px;
}
.work * {
box-sizing: border-box;
}
.work .category-buttons {
text-align: center;
margin: 0 0 60px 0;
}
@media (max-width: 610px) {
.work .category-buttons {
margin: 0 0 30px 0;
}
.work .category-buttons a {
display: inline-block;
width: 46%;
padding: 12px 10px !important;
margin: 1.5% 1% !important;
}
.work .category-buttons a:nth-child(even) {
margin-right: 0;
}
.work .category-buttons a:nth-child(odd) {
margin-left: 0;
}
}
@media (min-width: 611px) {
.work .category-buttons a:first-child {
margin-left: 0;
}
.work .category-buttons a:last-child {
margin-right: 0;
}
}
.work .category-buttons a {
XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
$(document).ready(function() {
var projects = $('.card');
var filteredProjects = [];
var selection = "all";
var running = false;
window.setTimeout(function() {
$('.all').trigger('click');
}, 150);
$(window).resize(function() {
buildGrid(filteredProjects);
});
$('.category-buttons a').on('click', function(e) {
e.preventDefault();
if (!running) {
running = true;
selection = $(this).data('group');
$('.category-buttons a').removeClass('active');
$(this).addClass('active');
filteredProjects = [];
for (i = 0; i < projects.length; i++) {
var project = projects[i];
var dataString = $(project).data('groups');
var dataArray = dataString.split(',');
dataArray.pop();
if (selection === 'all') {
$(project).addClass('setScale').queue(function(next) {
filteredProjects.push(project);
next();
}).queue(function(next) {
$(this).removeClass('setScale');
next();
}).queue(function(next) {
$(this).addClass('animating show')
next();
}).delay(750).queue(function() {
XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX

Related: See More


Questions / Comments: